Page 1 of 1

Is there any code I can put in to clear caches?

Posted: Tue Apr 16, 2019 10:59 am
by alan_sh
I am a bit concerned that mobile browsers (specifically chrome on android) is picking up old versions of some of my pages. When I specifically clear the cache (which ony seems to work for the page I am browsing) and then do a refresh, the correct layout is seen.

So, does anyone know of any code (html, I assume) that will force the browser to load the page from the net and not from internal cache? I'm not saying this will be a permanent solution, but while I am testing, it's what I need.

thanks

Alan

Re: Is there any code I can put in to clear caches?

Posted: Tue Apr 16, 2019 11:20 am
by Pablo
This has worked for some other users:

Code: Select all

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Re: Is there any code I can put in to clear caches?

Posted: Tue Apr 16, 2019 1:26 pm
by alan_sh
If I put that in the header of my master page, would that suffice?

Cheers

Alan

Re: Is there any code I can put in to clear caches?

Posted: Tue Apr 16, 2019 1:34 pm
by Pablo
Yes, that should work.

Re: Is there any code I can put in to clear caches?

Posted: Tue Apr 16, 2019 2:14 pm
by alan_sh
Thanks Pablo.

I've done it - now to see what happens going forward.

regards

Alan

Re: Is there any code I can put in to clear caches?

Posted: Wed Apr 17, 2019 12:00 pm
by Billywiz
Pablo, does this code go into -- Page properties/Meta Tags/User Defined

Cheers

Re: Is there any code I can put in to clear caches?

Posted: Wed Apr 17, 2019 1:04 pm
by Pablo
Pablo, does this code go into -- Page properties/Meta Tags/User Defined
Correct

Re: Is there any code I can put in to clear caches?

Posted: Wed Oct 16, 2019 5:14 pm
by desegno
Thanks Pablo for link,
Test it tomorrow, only on principal page and default.asp or in all page?

Re: Is there any code I can put in to clear caches?

Posted: Wed Oct 16, 2019 6:02 pm
by Pablo
All pages that you do not want to be cached by the browser.

Re: Is there any code I can put in to clear caches?

Posted: Thu Oct 17, 2019 5:04 am
by desegno
Ok so whit this "script" in all page the browser not save the cache for page and reload from website.
Thinked the script reload or update the cache. :lol:

Re: Is there any code I can put in to clear caches?

Posted: Sat Feb 06, 2021 4:59 pm
by edgrodsky
I have html pages which I use for my help files. On my website I provide an external link through a menu button. Is there a way to embed the suggested code you gave for clearing a cache into that button so I know my users are getting the current html help and not the help stored in the cache?

Thanks,

Ed

Re: Is there any code I can put in to clear caches?

Posted: Sat Feb 06, 2021 6:06 pm
by Pablo
The code must be placed inside the HTML page. It cannot be added to a button.

Re: Is there any code I can put in to clear caches?

Posted: Sun Feb 07, 2021 8:51 pm
by miguelss
Thanks for the code Pablo!