I'd like to avoid the "Expires" header, and use "Cache-Control" only - or maybe the other way around. The headers will account for a significant percentage of my traffic, so I'd prefer not to "use both".

AFAIK, the "Cache-Control" header was standardized in HTTP 1.1, but are there still web caches/proxies in use, which don't understand it?

Note: This could help answering a part of my stackoverflow (bounty) question


Consider using Expires for your expiry information. In the absence of max-age in Cache-control, it provides the same functionality. Use Cache-Control for additional cache control information. If you configure the caching correctly, you should see fewer validation requests which pass through intermediate caches. This will reduce your bandwidth.

Check RFC2616 section 14.9 for the cache values you might want to override. Cache-Control is mainly for overriding cache behavior of intermediate caches. However, there are directives for the browser cache as well.

  • Do you think, that some proxies won't understand Cache-Control? I'm asking, because if that's the case, I could have problems covering all my use cases. – Chris Lercher Jun 9 '10 at 19:06
  • It is amazing how old some of the systems running out there are. Also some cache implementers may not have implemented Cache-control. If you can't control the infrastructure end to end, I don't believe you can count on current standards applying. Review the RFC and your use cases against V1.0 and V1.1 cache behaviour. At worst, it would be cases requiring revalidation of dynamic content that might require Expires with Cache-control Max-age. For static content that is usually handled by including a version id in the URL, Dynamic content should have a short expiry. – BillThor Jun 12 '10 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.