Please consider disabling ETag!
Consider the following settings:
Header unset ETag FileETag None Header set Cache-Control "max-age=2678400"
The first two rules completely disable ETag, so the browser is somewhat forced to listen to the Cache-Control header. The last rule tells the browser to cache the file 2678400 seconds or 1 month. Change the settings to what suits you best. And apply this configuration in your directory that contains static files (e.g. by placing the .htaccess file in this directory)
Optionally, if you are using multiple servers for static content and / or are not sure of the latest changes these servers are reporting, consider using:
Header unset Last-Modified
It tells Apache not to serve the Last-Modified headers, so browsers can only listen on the max-age Cache-Control header.
These settings are used by me on many hightraffic websites, and disabling the ETag and Last-Modified headers helped reduce traffic to one fifth of what it was before. Especially Internet Explorer is very sensitive to these settings.
Be warned: Disabling Last-Modified will no longer request 304 Content Not Modified requests. In my experience, this is positive because the web server has fewer processing requests, and browsers rely more on the Cache-Control settings that you serve. But it may or may not suit you. Some browsers will try to check assets every few minutes if you give them the "Last-Modified" header, and so I would advise you to completely disable its use.
Oh, and if you're not sure about your caching; use http://www.redbot.org/ to check your assets, it quickly reports what your headers mean for the browser, and how to interpret the various cache control settings to use.
Andries Louw Wolthuizen Dec 13 '11 at 10:39
source share