Page expiration problem

J

Jure Erznoznik

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
 
D

dingbat

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top