IE doesn't honor Cache-control with location.href= calls

Discussion in 'HTML' started by Jure Erznoznik, Aug 8, 2005.

  1. I make sure that all my pages have the Last-Modified and Cache-control
    headers:

    Last-Modified: Mon, 08 Aug 2005 12:08:25 GMT
    Cache-control: max-age=86400, must-revalidate

    While this works well for links and back button in IE 6.0, it fails for
    Javascript location.href = "/" statement.
    The cache-control header is provided so that IE doesn't squeak about page
    being expired when the user presses the back button.

    Does anybody know how to get around this?

    Thanks,
    Jure
     
    Jure Erznoznik, Aug 8, 2005
    #1
    1. Advertising

  2. Jure Erznoznik

    Neredbojias Guest

    With neither quill nor qualm, Jure Erznoznik quothed:

    > I make sure that all my pages have the Last-Modified and Cache-control
    > headers:
    >
    > Last-Modified: Mon, 08 Aug 2005 12:08:25 GMT
    > Cache-control: max-age=86400, must-revalidate
    >
    > While this works well for links and back button in IE 6.0, it fails for
    > Javascript location.href = "/" statement.
    > The cache-control header is provided so that IE doesn't squeak about page
    > being expired when the user presses the back button.
    >
    > Does anybody know how to get around this?
    >
    > Thanks,
    > Jure


    What fails? If you go to "/", how does the current page expiration come
    into play?

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Aug 9, 2005
    #2
    1. Advertising

  3. Well, / represents a login screen when user is not logged in yet and main
    app window when he is.
    The problem occurs when I login, logout (which shows me the login screen
    again) and then press "Cancel" button, which has location.href="/" OnClick
    event. What I get is the app content from when i was logged in. Pressing
    refresh of course shows the login screen again since the user is not logged
    in.

    Thanks for any feedback,
    Jure

    "Neredbojias" <> wrote in message
    news:...
    > With neither quill nor qualm, Jure Erznoznik quothed:
    >
    >> I make sure that all my pages have the Last-Modified and Cache-control
    >> headers:
    >>
    >> Last-Modified: Mon, 08 Aug 2005 12:08:25 GMT
    >> Cache-control: max-age=86400, must-revalidate
    >>
    >> While this works well for links and back button in IE 6.0, it fails for
    >> Javascript location.href = "/" statement.
    >> The cache-control header is provided so that IE doesn't squeak about page
    >> being expired when the user presses the back button.
    >>
    >> Does anybody know how to get around this?
    >>
    >> Thanks,
    >> Jure

    >
    > What fails? If you go to "/", how does the current page expiration come
    > into play?
    >
    > --
    > Neredbojias
    > Contrary to popular belief, it is believable.
     
    Jure Erznoznik, Aug 9, 2005
    #3
  4. Jure Erznoznik

    Neredbojias Guest

    With neither quill nor qualm, Jure Erznoznik quothed:

    > Well, / represents a login screen when user is not logged in yet and main
    > app window when he is.
    > The problem occurs when I login, logout (which shows me the login screen
    > again) and then press "Cancel" button, which has location.href="/" OnClick
    > event. What I get is the app content from when i was logged in. Pressing
    > refresh of course shows the login screen again since the user is not logged
    > in.


    Have you tried using location.replace and/or a query string selectively
    attached to the url?

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Aug 10, 2005
    #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. Leon
    Replies:
    1
    Views:
    10,226
    Boban Dragojlovic
    Jun 24, 2003
  2. saiho.yuen
    Replies:
    3
    Views:
    472
    kaeli
    Sep 14, 2004
  3. Stuart Kendrick
    Replies:
    2
    Views:
    400
    Stuart Kendrick
    Aug 27, 2004
  4. Replies:
    2
    Views:
    542
  5. Alex Bird
    Replies:
    3
    Views:
    197
    Thomas 'PointedEars' Lahn
    May 9, 2008
Loading...

Share This Page