HTML Expires

New to coding. I want the webpage to be reloaded (from server not cache) every hour.
I do updates on the website, and I wind up seeing the old version for quite a while.
I heard there is an " Expire " command/code that can be inserted for this. I think in the header.

Need Help?

John B

I would like to know that code also. :smile:

If your updating a site like that, wouldn’t it be better to be using a CMS?

Anyway there are tags like the following, I have never used them myself.

This one is deceptive and actually doesn’t mean no cache lol.

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

More info here, with compatibility details. Cache-Control - HTTP | MDN

Your easiest solution is to select the option in Blocs at time of export to Cache bust CSS and JS. This forces the browser to show the most recent update.

I use this constantly during development, then turn it off when the site goes live.

2 Likes

@Flashman why do you turn it off when the site goes live?

Just deselect it as an option with your final exported upload version once everything is finalised.

30

Hi John,

I have some web service providers in which cache at the server causes the pages not to be updated right away and timeout is controlled at the server. I’m not sure how to directly control this server cache timer (ie. to update every hour), but I found if text “?nocache=1” is appended to URL, this can cause the updated page to be seen.

Ex: http://webaddress.com/?nocache=1 or http://webaddress.com/page.html?nocache=1

It doesn’t affect the server timer, but at least you may see the update until server cache timeout occurs later. If any of the other methods do not work for you, maybe this will help.

Good Luck!

Paul

1 Like

https://markohoven.com/2018/11/09/prevent-caching/

2 Likes