Load a page without loading a cached page

1

Here is the situation I have. I have a page that is generated using a bash script (basically echo and some other command >> a html file). I have a link to this page. If I "clear private data" or never have opened the page before, or close and reopen, the page is downloaded from my server and the updated version is displayed. However, users sometimes will go back to the page again...and if the page is cached in the web browser, the page shown is not the updated one. Basically I want to have the page refresh once to show the updated information.

agz

Posted 2013-04-13T04:10:25.547

Reputation: 6 820

How are you opening the page? Is is served from a web server? – Paul – 2013-04-13T04:14:03.637

Its just an ahref to it and yes its served from a web server – agz – 2013-04-13T04:18:47.047

Answers

2

You would need to include headers for the bash script/html page you're serving up to send non-cached responses back to the users.

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

This answer should give you a better idea of how you can implement the headers according to what your script or html is like.

On the users end hitting Shift F5 should work, but as you know it's not optimal; using non-caching headers is much better.

l'L'l

Posted 2013-04-13T04:10:25.547

Reputation: 1 840

I ended up using this: <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> – agz – 2013-04-13T05:18:34.400