Max-age | Expires |
---|---|
Relative | Absolute |
Takes priority | Used if max-age is missing |
No clocks and time zones
No DDOS
E-tag | Last-Modified |
---|---|
MD5 hash of file | Date |
Can I use the cached file?
Has the time in max-age passed?
Cache-control
Expires
Current time < Expires time?
Yes
No
Use cache
Do I need to get a new version?
Yes
No
Use cache
Has it been modified since?
Has the Etag changed?
Get a new version!
Yes
Yes
No
Use cache
Use cache
No
Has the time in max-age passed?
Cache-control
Has the time in max-age passed?
Cache-control
Yes
No
Use cache
Has the Etag changed?
Has the time in max-age passed?
Cache-control
Yes
No
Use cache
Has the Etag changed?
Get a new version!
Yes
No
Use cache