Page expiration problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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

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?


Re: Page expiration problem

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)

Re: Page expiration problem

Jure Erznoznik wrote:


Quoted text here. Click to load it

You may find this of some interest... /


Re: Page expiration problem

Thanks, this article really helped.
Solved my problem in 5 minutes :-)


Quoted text here. Click to load it

Site Timeline