I have a website that because of an ill-prepared apache conf file has instructed users to cache a website URL several years into the future. As a result, when a person visit
You can make all the necessary changes inside the HTML files, like
But also, you can explicitely tell Apache to use mod_expires.c module, and add a couple of directives to httpd.conf file:
# Turn on the module.
ExpiresActive on
# Set the default expiry times.
ExpiresByType text/html "modification plus 5 seconds"
ExpiresByType text/javascript "modification plus 5 seconds"
ExpiresDefault "access plus 2 days"
This way you add the http headers cache-control and expires, to responses, in order for thw browser to update the cache 5 seconds after the file was modified in the origin, for those kinds of files, and 2 days after being accessed by the browser for all the other kinds of files.
Hope this helps.