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 visits the site, they often make no attempt to even request the page. The browser just loads the HTML from cache.
This website is about to get a major update, and I would like for users to be able to see it. Is there a way for me to force a user to actually re-request the webpage? I fear that for some users, unless they happen to press F5, they may see the old webpage for several years.
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:
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.
It is arguable that if your "major update" is just in a few (2 or 3) weeks, you only need to reconfigure your apache conf now (no far future stuff for html - only for assets and content that will most likely never change). The Firefox cache is ~50MB by default and that is not much because images get also cached and modern websites have a lot of content.
Not perfect - but thats what I would do - when I don't want to or can't change the URL's ;)