Webpages and caching...

IEC

Elite Member
Super Moderator
Jun 10, 2004
14,600
6,084
136
So...

Let's say I update a page frequently. But a lot of users have caching enabled and do not check for the latest version of a page (sigh)

Should I resort to *cringes*:

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
Disable caching of the page...

OR

<META http-equiv="EXPIRES" CONTENT="TUES, 1 JAN 2000 12:00:00 GMT">
Trick the cache into always loading the latest...

OR

???

What's the best method for this?
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I always use <meta http-equiv="Cache-Control" content="no-cache"> and it works 99% of the time.
 

IEC

Elite Member
Super Moderator
Jun 10, 2004
14,600
6,084
136
Originally posted by: sourceninja
I always use <meta http-equiv="Cache-Control" content="no-cache"> and it works 99% of the time.

Thanks, I'll try that.

And test it in IE/FF/Opera. Lulz.
 

lozina

Lifer
Sep 10, 2001
11,711
8
81
For dynamic content pages I always use the meta tags to disable caching:

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

For static pages I sometimes like to append a version number on the filename so when you need to update the page you update the filename with the new version number and then the browser thinks its a totally new page so does not load whats in its cache