I noticed that Google sets the expiration of its HTML to a date in the past:
Expires Thu Jan 01 1970 00:00:00
How do I configure .htaccess to do this? I use ExpiresByType
to set the expiration of my other resources, but they are all future times (e.g. access plus 10 years
). Any suggestions on how to set it for the past? Thanks.
By setting the expiration of the HTML to the past, I'm assuming you're trying to prevent your HTML from being cached. Unfortunately, you cannot use the Expires directive as it only works for future dates. You can use header commands though to control how your HTML files are cached.
The
mod_headers
module will need to be installed in Apache to use this method.EDIT: Alternatively, if you're using PHP, you can set these headers using PHP's
header
function.