Problem with IE7 caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I 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 in
     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 to
     return 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.

Charlene

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux