Viewing How do I force a cache reload on VIEWERS browsers?

How do I force a cache reload on VIEWERS browsers?



User: Lisa L. 4 years ago
I've made a bunch of changes to a website... adding and removing images and shapes. Refreshing the page doesn't to it - the only way I can review my changes is to remove cache from my browser. Most viewers won't know how to do that...

What script can I place into the site wide header code to force a refresh of cache?

Is there a way to do "Version" updates, so that the cache does NOT have to reload with every page?

Thanks!
User: Roddy 4 years ago
Rather than having to delete the cache/browser history, place a ? at the end of a URL to force the browser to load from the server or hit the refresh button a few times.

Sites that display up to the minute info like weather, stock prices etc use the refresh meta tag ...

<meta http-equiv="refresh" content="300">

The number in the meta tag is the time expressed in seconds so, in the above example, the page content will refresh every 5 minutes. For most purposes, the value should be a lot longer.

The tag can be inserted in the Head Code box in the Page inspector to effect a particular page or in the Site Wide Head Code box in the Publishing Settings page to effect the whole site.

NOTE
The use of this tag is discouraged by the WWC "since unexpected refresh can disorient users and interfere with the browser's back button".

-------------------------------
Roddy

Website: http://everwebwidgets.com
Contact: http://everwebwidgets.com/ewWidgets-home/contact.html
NOTE: I am an EverWeb user and NOT affiliated with EverWeb! Any opinions expressed in this forum are my own.
User: Aristomenis X. 4 years ago
You can also try using a little script :

[code]
<script>
window.onload = function() {
if(!window.location.hash) {
window.location = window.location + '#loaded';
window.location.reload(true);
}
}
</script>
[/code]

This will force reload (from the server) once each page where you add it on. Don't know if it's the best method though as the visitor has to load the whole page from cache first.

Other than that you also have the following option:

[code]
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
[/code]

(both should be used)

finally another option is:

[code]
<META HTTP-EQUIV="EXPIRES" CONTENT="0">
[/code]

Setting EXPIRES to 0 forces a modification check at each visit.

Hope something works, good luck.

Last edit 4 years ago


Post Reply
You must login or signup to post.