I'm having trouble formulating HTTP cache headers for the following situation.
Our server has large data that changes perhaps a couple times a week. I want browsers to cache this data. Additionally, I want to minimize latency from conditional gets as the network is unreliable.
The end behavior I'm after is this:
- Client requests a resource it hasn't seen before.
- Server responds with resource along with ETag and
max-age(24 hours). - Until 24 hours has passed, client will use cached resource.
- After the expiration date, client will perform a validate request (
If-None-Match: [etag]) - If resource has not changed:
- server responds with
304 Not Modified - client is somehow informed that the existing resource has a new expiration date 24 hours from now
- return to step 3
- server responds with
Boiled down to its essense... can a 304 response contain a new max-age? Or is the original max-age honored for subsequent requests?