Forced Refresh

liunx

Guest
Hey everyone...a quick question<br />
<br />
I recently made changes to a site. I completely wiped the old site and uploaded the new one to the server. All of the pages are different, but the names and file structure is the same.<br />
<br />
A friend didn't notice the changes as his browser was loading the old pages from the cache instead of Download <!--more-->ing the new pages from the site (or at least I am guessing this is what happened... I can't think of any other reasons as the old pages aren't even on the server anymore).<br />
<br />
Is there a way of forcing a browser to load the server pages instead of just going to the cache each time that they come to the site? This way I can always be sure that when the link to the home page they are actually getting the most current page.<br />
<br />
Thanks. I eagerly await any advice,<br />
<br />
James<!--content-->Let's think about this for a second... If the client is going to the cache to get the page, how is it going to get the update to force the refresh? lol. Well, I'd say no. Maybe there is a way, but I really doubt it. However, I think that if the client bookmarks your page, and hits "Make Available Offline", they can set some stuff to Download <!--more--> the page every-so-often. Maybe that would work...<!--content-->Hi James,<br />
<br />
Exuro is correct in that if the person is viewing a cached version of your page, it won't pick up the coding to autorefresh. However you do have the following solutions available to you:<br />
<br />
1. Place the below code in your meta tags<br />
<br />
<META HTTP-EQUIV="refresh" CONTENT="300"><br />
<br />
This will refresh the page every 5 minutes, however again as mentioned above, if the user is viewing a cached page prior to adding this code, it will not work for them. As well it could be annoying if someone were to be on the page for more than 10 minutes and would not take effect till the first 5 minuites was up. Probably not the best solution for you.<br />
<br />
2. You could also offer a refresh button on the screen letting the user know there may be updated content. When they click the button , it would refresh the screen. See below for code<br />
<br />
<FORM><br />
<INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh"><br />
</FORM><br />
<br />
Again, the same applies to a person viewing a previously cached page. But better than option 1.<br />
<br />
3. Depending on your comfortability, skill level and accessibility, if you convert your pages to .asp (active server protocol), then each time your page is viewed it will automatically call for the pages from the server, regardless fo the users cached memory.<br />
<br />
To do this, your server must of course support asp, and you will need to learn a little about how to change your code. (Not much really)<br />
<br />
This latter is the best of the 3 options, but as mentioned requires the server support of asp.<br />
<br />
See the following url for more info on options 1 & 2<br />
<br />
<!-- m --><a class="postlink" href="http://htmlgoodies.com/tutors/refresh.html">http://htmlgoodies.com/tutors/refresh.html</a><!-- m --><br />
<br />
Good Luck<!--content-->Try some code like this to keep the pages from caching:<br />
<br />
<meta http-equiv="cache-control" content="no-cache, must-revalidate"><br />
<meta http-equiv="pragma" content="nocache"><!--content-->
 
Back
Top