Page expiration problem

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

  1. Hi guys,

    I have written a small application in PHP. HTTP Server used is Apache 2.
    PHP marks the pages it generates as non-cacheable which is problematic in
    IE. If I press the Back button, IE will say that page has expired from cache
    and I have to press the refresh button. Firefox does not have the same
    problem.

    To solve the problem, I modify the PHP headers so that page expiration is
    set to 300 sec. This solves the above problem, but a new one appears:
    IE will load the pages from cache which is of course bad since they contain
    dynamic data (login information, database data).

    Question: How do i make IE stop telling me the page has expired and
    automatically reload instead?

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

  2. Jure Erznoznik

    Guest

    Think first of all what your page expiry _should_ be, and then worry
    afterwards about how browsers are interpreting this.

    "300 sec" sounds like a bad idea. It should either be cacheable for a
    long session, or it should never be cached. The page where you _enter_
    the password can be cached for ages, the responses after this point
    maybe should never be. I doubt you'll ever find a single set of headers
    that's appropriate to send on all your pages (but with PHP you can
    easily change them on a per-page basis, even more easily than with ASP)
     
    , Aug 3, 2005
    #2
    1. Advertising

  3. Robert Frost-Bridges, Aug 3, 2005
    #3
  4. Thanks, this article really helped.
    Solved my problem in 5 minutes :)

    Regards,
    Jure

    "Robert Frost-Bridges" <> wrote in message
    news:...
    > Jure Erznoznik wrote:
    >
    > [...]
    >
    >> Question: How do i make IE stop telling me the page has expired and
    >> automatically reload instead?

    >
    > You may find this of some interest...
    >
    > http://www.mnot.net/cache_docs/
    >
    > regards,
    > --
    > Robert
    > http://brightonfixedodds.net
    >
     
    Jure Erznoznik, Aug 4, 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. Ken

    Page expiration

    Ken, Nov 1, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    1,156
    Guest
    Nov 3, 2003
  2. Vijay
    Replies:
    3
    Views:
    1,508
    Saravana [MVP]
    Nov 4, 2003
  3. Josh Anderson - remove Zs to reply

    Page expiration warning on back navigation

    Josh Anderson - remove Zs to reply, Nov 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,356
    Saravana [MVP]
    Nov 19, 2003
  4. naijacoder naijacoder

    Page expiration - Is it with Session.Timeout

    naijacoder naijacoder, Sep 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    452
    Greg Burns
    Sep 9, 2004
  5. Nitin

    Page Expiration

    Nitin, Mar 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,159
    Patrick Olurotimi Ige
    Mar 3, 2005
Loading...

Share This Page