I want to set cache headers using the mod_expires module from apache. My configuration looks something like this:
<LocationMatch ^/static > ExpiresDefault "access plus 1 years" </LocationMatch>
The problem is that the files are generated by a third system that I do not control. This system provides files with the following headers:
Date Mon, 24 Oct 2011 08:39:02 GMT Cache-Control no-cache,no-store,must-revalidate Pragma no-cache Expires Thu, 01 Dec 1994 16:00:00 GMT
These headers do not allow you to set cache headers using mod_expires. http://httpd.apache.org/docs/2.2/mod/mod_expires.html tells us why:
When the Expires header is already part of the response generated by the server, for example, when a CGI script is generated or proxied from the source server, this module does not change or does not add the Expires or Cache-Control header.
Is there any possible way around this rule and overwrite headers with mod_expires?
Update: One possible solution to avoid this limitation is to use only mod_headers to set cache headers. Unfortunately, this is not an alternative, because the values ββmust be calculated.
Thanks for this.
apache mod-expires
scheffield
source share