Updated: 10/8/2003; 8:04:09 AM.
Joe's Weblog
The purpose of this weblog will be to address open source issues relative to ITS. This includes software we are currently using such as RedHat Linux, Apache, MySQL, PHP, Tomcat, JBOSS, etc. I will also include issues regarding enterprise web application development utilizing JAVA and J2EE. Some networking issues may also be included. Enjoy...
        

Thursday, October 24, 2002

While working with the phpBB software it appears that some of the PHP pages are cached in the browser.  This causes problems for the application as the browser cache overwrites the information sent from the server yielding incorrect screen information that it not up to date.

While researching through the PHP manual I came across the following:

PHP scripts often generate dynamic content that must not be cached by the client browser or any proxy caches between the server and the client browser. Many proxies and clients can be forced to disable caching with

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified

header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1

header("Cache-Control: post-check=0, pre-check=0", false);

header("Pragma: no-cache"); // HTTP/1.0

Note: You may find that your pages aren't cached even if you don't output all of the headers above. There are a number of options that users may be able to set for their browser that change its default caching behavior. By sending the headers above, you should override any settings that may otherwise cause the output of your script to be cached.


11:03:42 AM    comment []

© Copyright 2003 Joe Leary.
 
October 2002
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Sep   Nov


Click here to visit the Radio UserLand website.

Subscribe to "Joe's Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.