HTTP Caching
Expires
(HTTP/1.0) was deprecated, use Cache-Control
instead in HTTP/1.1.
Normal Use
Response
Last-Modified: xxx
Cache-Control: max-age=86400
Age: 3600
ETag: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Request
If-Modified-Since: xxx
If-Match: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
If-None-Match: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ETag: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Vary: User-Agent
Vary: Accept-Encoding
Forcing Reloading (Request)
Cache-Control: no-cache
Static Files
Cache-Control: public, max-age=15552000, immutable
Age: 2592000
ETag: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Dynamic Request
Cache-Control: no-store
Only for client browser
Cache-Control: private, max-age=86400
ETag: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
References
- MDN - HTTP
- David Gourley & Brian Totty. HTTP: The Definitive Guide (2002) ISBN: 978-1-56592-509-0 (《HTTP权威指南》)
- RFC 9111 - HTTP Caching (2022.6) (Obsolete RFC 7234)
- RFC 9110 - HTTP Semantics (2022.6) (Obsolete RFC 7232)
- RFC 9112 - HTTP/1.1 (2022.6) (Obsolete RFC 2068, RFC 2616)
- W3C - HTTP - Hypertext Transfer Protocol
- Wikipedia - HTTP
- Wikipedia - HTTPS