1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Force load of web page vs. load from cache?

Discussion in 'Software Development' started by Riverglen, May 2, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. Riverglen

    Riverglen Thread Starter

    Joined:
    Aug 28, 2006
    Messages:
    459
    First Name:
    Larry
    I have a very simple web page that automatically updates daily. However, very often when I view it I just get the version that is in my browser cache rather than the latest version from the web. I have to do a manual refresh from the browser to see the latest version. Not a problem for me, but other viewers of the page may not realize they aren't seeing the latest information.

    Is there an HTML tag or some such that can be included in the page that will force a refresh and override any old version that the viewer may still have in their browser cache?
     
  2. Sponsor

  3. leroys1000

    leroys1000 Banned

    Joined:
    Aug 15, 2007
    Messages:
    6,319
  4. Riverglen

    Riverglen Thread Starter

    Joined:
    Aug 28, 2006
    Messages:
    459
    First Name:
    Larry
    Many thanks. Looks like exactly what I need. One thing is still a little unclear however. Does this tag result in a one-time update or a periodic refresh. A periodic refresh would be overkill for what I want to accomplish.
     
  5. leroys1000

    leroys1000 Banned

    Joined:
    Aug 15, 2007
    Messages:
    6,319
    It causes the page to refresh anytime it is loaded,so you always
    get the new view.
     
  6. Riverglen

    Riverglen Thread Starter

    Joined:
    Aug 28, 2006
    Messages:
    459
    First Name:
    Larry
    Well, I tried it, and it works fine for my purposes. But it does result in a periodic update. So, if all you want is an initial forced update from the on line web page, you have to trade off the period of the update against the wait for the initial (and in my case the only needed, refresh). In my particular case, a ten second update interval is acceptable since the web page is so small that the update is instantaneous, and repeating it every ten seconds is not really a problem, albeit kind of inelegant.
     
  7. DaBeers

    DaBeers

    Joined:
    Oct 30, 2008
    Messages:
    276
    A better fix might be to drop a cookie. If no cookie is found, or it is older that 24 hours, perform an automatic refresh and drop a new cookie. Otherwise, continue normally.
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/994648