HTTP 1.1 introduced a new class of headers, Cache-Control response headers, to give web publishers more control over their content and to eliminate the limitations of Expires.
Expires is a type of pain due to its limitations. First, since there is an absolute date, the clock on the web server and the client cache must be synchronized; if they have a different idea of time, the expected results will not be achieved, and caches may mistakenly consider outdated content fresh.
Another issue with Expires is that it is easy to forget that you specified some content to expire at a specific time. If you do not update the expiration time before it is sent, each request is returned to your web server, increasing the load and delay.
So, do I need to use Expires more, or is Cache-Control (in particular, max-age set to some distant future number of seconds) enough for my static content? I would like to avoid using Expires, but should I install both?
source
share