Forum Moderators: coopster

Message Too Old, No Replies

no cache and sessions

         

scorpion

4:25 pm on Dec 7, 2002 (gmt 0)

10+ Year Member



Is it a good idea to send a no-cache header when using cookies and sessions in a html-php document? How can you have the best of both worlds - fast cache loading sometimes AND make sure PHP code segments are not skipped, is there a way to not cache PHP sections, but cache everything else?

andreasfriedrich

4:38 pm on Dec 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Itīs the actual HTML documents that get cached. PHP is just one way to produce those HTML documents. Caching is done in a later stage than producing the document. No, there is no way to not cache PHP sections, but cache everything else.

If you use a CMS that may use some form of caching for the not so dynamic parts of a page. But this bahaviour cannot be controled by HTTP header fields.

Andreas

scorpion

5:28 pm on Dec 7, 2002 (gmt 0)

10+ Year Member



I see, but isn't this a BIG problem for dynamic content? Caching the resultant page from dynamic code is bound to be "out of date"

Is there an article or suggestion what is the MOST appropriate solution to this problem (short of asking users to change their browser settings)?

andreasfriedrich

5:45 pm on Dec 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have truly dynamic pages then sending a no cache header is the way to solve this problem.

See [php.net...] and [web-caching.com...] for more info.

Andreas