Inserting cache-control: no-store...

User 462989 Photo


Registered User
53 posts

I am trying to force the loading of a web page to come from the server every time, as a hard refresh, with no cache.
Can I do this in HTML (header and/or body?) or must I use Java script?
Any guidance I can get on this will be greatly appreciated - I am basically not a coder so please do the "advice for dummies" answer!
Can this be inserted as part of the code in the menu/text link that calls that page, so it forces a refresh for every visitor who clicks on that link?

Thank you
Nick
User 122279 Photo


Senior Advisor
14,457 posts
Online Now

I think you may get some updated help at w3schools.com .
I haven't needed it for some years, and last time I did, I popped this into a .htaccess file:

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers

Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 462989 Photo


Registered User
53 posts

Hi Inger
Thank you very much.
Regards
Nick

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.