Re: Problem with IE7 caching
| From: | Phpster | Date: | Sat, 08 May 2010 00:57:31 +0000 |
| Subject: | Re: Problem with IE7 caching | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305003@lists.php.net to get a copy of this message | ||
On May 7, 2010, at 8:41 PM, Karl DeSaulniers <karl@designdrumm.com> wrote:
On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote:One other option is to fool the browser by appending a time variable to the end of the URL to get around caching. Bastien Sent from my iPodI have a problem with IE7. It has a tendency to cache output produced by PHP. It occurs in a few ways: * I make a minor change to a php program, but you can't see it inSounds like you need attach the data somehow when hitting that return link. Maybe an array $newData = array();//fill this array with the new values On your form page, set up a if(isset($newData)){ //fill form fields } I did notice that on your header, you did not have "no-cache".IE7, but can in FF. CTRL-Refresh does not make it work.* I modify data using a form in IE7. When I click on a link toreturn to the form the old data is still there, but if I hit CTRL-Refresh the new values are there.I have set up some caching to try to fix the second issue, but I'm not sure if I've chosen the right header lines: $now = time (); $prety_lmtime = gmdate ('D, d M Y H:i:s', $now). ' GMT'; $prety_emtime = gmdate ('D, d M Y H:i:s', $now + $interval). ' GMT'; // Backwards Compatibility header ("Last Modified: $prety_lmtime"); header ("Expires: $prety_emtime"); // HTTP/1.1 Support header ("Cache-Control: private, max-age=$interval,s-maxage=0"); I got this code from a book. I don't want to prevent caching completely because I want to be able to go back to the form when there is an error in validation of fields before entering it into the db. But I do want to be able to see the new data after it is entered in the db. Charleneheader ("Cache-Control: private, no-cache, max-age=$interval,s-maxage=0");HTH Karl DeSaulniers Design Drumm http://designdrumm.com