dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Forced Refresh

  1. #1
    Join Date
    Nov 2002
    Posts
    204

    Forced Refresh

    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,

    James

  2. #2
    Join Date
    Dec 2002
    Location
    Taiwan
    Posts
    1,297
    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...

  3. #3
    Join Date
    Jul 2003
    Posts
    7

    Auto Refresh

    Hi James,

    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

    <FORM>
    <INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh">
    </FORM>

    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

    http://htmlgoodies.com/tutors/refresh.html

    Good Luck

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    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">

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles