Hey everyone...a quick question
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.
A friend didn't notice the changes as his browser was loading the old pages from the cache instead of downloading 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).
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.
Thanks. I eagerly await any advice,
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 the page every-so-often. Maybe that would work...
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:
1. Place the below code in your meta tags
<META HTTP-EQUIV="refresh" CONTENT="300">
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.
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
<INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh">
Again, the same applies to a person viewing a previously cached page. But better than option 1.
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.
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)
This latter is the best of the 3 options, but as mentioned requires the server support of asp.
See the following url for more info on options 1 & 2
Try some code like this to keep the pages from caching:
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="pragma" content="nocache">
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)