Code to trigger cache dump?

setabkcin

New Member
Hi, I'm new to the forum. I have a question. I couldn't find it anywhere when I searched. Is there a code (html or maybe js) that I can embed into a website to trigger the viewers cache to refresh? The website that I need this for is updated very regularly and my director is concerned about returning viewers loading old images, etc. when they come back to the site. Thanks.
 

jnjc

New Member
I think it's fairly difficult to trigger a cache refresh once the page is cached. You best bet is to put something in the page header to tell it not to cache in the first place (or to expire). You can use meta tags like:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

Which 'should' stop you page caching at all or

<meta http-equiv="expires" content="1">

which should set an expiry on your the page cache

You can also set you HTTP server to tell the browser not to cache or set an expiry.

HTH,
JC
 
Top