Forum Moderators: phranque
I have a section of my site that I update once a week. I'd like to make sure visitors see the most updated version and not a cached version, but I don't need to have the page refreshing too often. Would something like...
<meta http-equiv="refresh" content="86400">
be good? This would allow visitors to see the most updated version instead of a cached version of the page if it's been more than 24 hours (86400 seconds) since their last visit, right?
<HTML>
<HEAD>
<META HTTP-EQUIV="REFRESH" CONTENT="5">
<TITLE> Pragma No-cache </TITLE>
</HEAD>
<BODY>
This is an example of where to place the second header section<br>
so that the "Pragama, No-Cache" metatag will work as it is supposed to.<br>
</BODY>
<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD>
</HTML>
MORE INFORMATION
Note that the <HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> metatag does not work with Internet Explorer 5.
<meta http-equiv="refresh" content="86400">
... This would allow visitors to see the most updated version instead of a cached version of the page if it's been more than 24 hours (86400 seconds) since their last visit, right?
No, that refreshes the page 24 hours after they load it. Unless they look at it without leaving the page for the whole 24 hours, it'll never go into action.
You can try using meta tags to control caching, but setting the expiry headers server-side is the only reliable method.