PDA

View Full Version : "Empty the browser's cache" - Can we trigger this command from the server ?



michelangelo
07-06-2015, 03:21 PM
I refer to an old fashioned bicycle club website, where webpages are hand written in pure html using a text editor.

<abeille-cyclotourisme.fr/>

To facilitate site management and navigation within the site, the structure of this website is such that page names are constant, while the content of the page changes over time. As an real-time example, one serie of monthly pages describes the bicycle club's monthly programs. Irrespective of the year, the july page's address is :

<http://www.abeille-cyclotourisme.fr/programmes/07_juillet.html/>

This page (named "07_juillet.html") is modified two times a year: in April where a preliminary program for july is posted and by end june when the final version of the July [2015] program is posted.

Problem. For some visitors, from time to time, their browser will lazily continue showing the old version of the page and not bother loading the new version of the page from the updated website. These visitors will [wrongly] believe the website was not updated. Apparently, emptying the browser's cache always does the trick of fixing the problem, but this fix must be done by the visitor, it relies on the visitor's browsing expertise, it is not directed on the server side.

Any reason for the cause of such a browser behavior ?

Any suggested more robust cure from the server side (by a script or otherwise) ?

Any suggestion to do away with the cache issue by altering the site's structure in such a way that the page name would effectively change two times a year (like "2015_2_07_juillet.html"), what about automagically changing all links (about 20 of them) pointing to the july page ?

Other suggestions ?

TIA. :-)

vansmith
07-07-2015, 12:21 AM
I've seen this come up with testing pages (which is why I now test local web pages in a private window). Apparently, there are some meta tags that will disable caching of a page (although I've no idea if they work). See here (http://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers). Now, one thing to note is that meta tags may not work across all browsers but comments in that thread suggest that the multiple tags provided as a solution are laid out as such to address cross-browser issues.

michelangelo
07-07-2015, 10:11 AM
I've seen this come up with testing pages (which is why I now test local web pages in a private window). Apparently, there are some meta tags that will disable caching of a page (although I've no idea if they work). See here (http://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers). Now, one thing to note is that meta tags may not work across all browsers but comments in that thread suggest that the multiple tags provided as a solution are laid out as such to address cross-browser issues.
Thanks, this is very helpful. I will use initially (but only in the pages that change from time to time) the following combo and see if it works over time.

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />

Then, since the above may not help much but, when it does help, would add excessive server requests hence time baggage to visitors, I will, later on, use only the expire date, adjusted at each modification, to prevent unnecessary server requests.

<META HTTP-EQUIV="EXPIRES"
CONTENT="Fri, 01 Jul 2016 01:00:00 GMT">

(01:00:00 because most visitors are not from Greenwich but from France)

And see if it works.

:):):)

michelangelo
07-30-2015, 09:47 AM
Then, since the above may not help much but, when it does help, would add excessive server requests hence time baggage to visitors, I will, later on, use only the expire date, adjusted at each modification, to prevent unnecessary server requests.

<META HTTP-EQUIV="EXPIRES"
CONTENT="Fri, 01 Jul 2016 01:00:00 GMT">

(01:00:00 because most visitors are not from Greenwich but from France)

And see if it works.

:):):) The above is what I finally did on the website, mainly to minimize the potential for annoyance to the visitors, as reloading pages always take time and I know when I will update the page.