Force reload of changed page?

Discussion in 'Javascript' started by Nige, Nov 14, 2003.

  1. Nige

    Nige Guest

    I'm not sure if this is the right group, but I thought the solution may
    be JS related, hence my post.

    I've got a web site that is frequently updated; yesterday several
    subscribers contacted me to say they couldn't see the update. I suspect
    this is a cache problem, so is there a way to force a page to be
    reloaded when it is changed. I realize it is too late for the current
    pages, but I'd like to include something later.


    --
    Nige

    Please replace YYYY with the current year
    ille quis mortem cum maximus ludos, vincat
    Nige, Nov 14, 2003
    #1
    1. Advertising

  2. Nige,
    Don't think this is a JS question really, always useful to use search
    engines to see if you can find the answer first. But try:-

    <META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">

    it may help. Otherwise I know you can defo do it server side with asp
    using:-

    response.expires = 0

    Hope that helps

    Stu


    "Nige" <> wrote in message
    news:...
    > I'm not sure if this is the right group, but I thought the solution may
    > be JS related, hence my post.
    >
    > I've got a web site that is frequently updated; yesterday several
    > subscribers contacted me to say they couldn't see the update. I suspect
    > this is a cache problem, so is there a way to force a page to be
    > reloaded when it is changed. I realize it is too late for the current
    > pages, but I'd like to include something later.
    >
    >
    > --
    > Nige
    >
    > Please replace YYYY with the current year
    > ille quis mortem cum maximus ludos, vincat
    Stuart Palmer, Nov 14, 2003
    #2
    1. Advertising

  3. Nige

    Nige Guest

    In comp.lang.javascript, Stuart Palmer wrote:

    ><META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
    ><META HTTP-EQUIV="Pragma" CONTENT="no-cache">


    Thanks, but I didn't really explain properly. I want to make sure that
    my web content is reasonably current, but at the same time I don't want
    to bypass caching completely.

    I'm looking for a way to cache a page for 24 hours after a user accesses
    it, but if they come back after that time, then reload the page.

    I understand using HTTP headers, rather than META tags, is the best way
    for maximum compatibility.

    I've seen a few scripts in something called PHP, but I don't think I can
    use this on my site.

    Can anyone help, or offer an alternative?


    --
    Nige
    --
    Nige

    Please replace YYYY with the current year
    ille quis mortem cum maximus ludos, vincat
    Nige, Nov 18, 2003
    #3
  4. Nige wrote:

    > In comp.lang.javascript, Stuart Palmer wrote:
    >><META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
    >><META HTTP-EQUIV="Pragma" CONTENT="no-cache">

    >
    > Thanks, but I didn't really explain properly. I want to make sure that
    > my web content is reasonably current, but at the same time I don't want
    > to bypass caching completely.


    "Wash it but don't make it wet." ;-)

    > I'm looking for a way to cache a page for 24 hours after a user accesses
    > it, but if they come back after that time, then reload the page.


    Only server-side scripting can provide that reliably. You need the script
    to set the Expires HTTP header and the `meta' element according to the
    current date, i.e. the date the user accesses the document.


    PointedEars
    Thomas 'PointedEars' Lahn, Nov 18, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sia Jai Sung

    Force reload of ASP page after processing

    Sia Jai Sung, Jan 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    8,163
  2. UJ
    Replies:
    6
    Views:
    75,929
    pcpgmr
    Mar 23, 2010
  3. tshad

    no-cache to force reload new page

    tshad, Jul 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    822
    tshad
    Jul 27, 2006
  4. zdhiu
    Replies:
    1
    Views:
    240
    zdhiu
    Jan 20, 2004
  5. Mark Anderson
    Replies:
    4
    Views:
    173
    Mark Anderson
    Mar 2, 2005
Loading...

Share This Page