[pLog-svn] r3462 - plog/trunk/class/view/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Thu May 25 17:28:59 GMT 2006


Author: mark
Date: 2006-05-25 17:28:59 +0000 (Thu, 25 May 2006)
New Revision: 3462

Modified:
   plog/trunk/class/view/admin/adminview.class.php
Log:
We have to add the no-cache header setting to adminview to avoid stupid bug in IE.. :(

When we use window.open to open a url, if the url already cached in browser tmp folder. The browser will use the cache first, even you set no-cache in html <meta> tag.

The only one way to solve this is:

1. Add a random parameter in url (let IR treat it as different url, or
2. Send the no-cache header through PHP header() function

I choose the 2nd way to solve this.

This could solve when user use pull-down menu to add template and the templates list does not change in blogsettings problem. 

* Actually, the data already changed in db and session but not in browser cache... so, we should use this way to force the cache expire. :(

** This problem never happened in Firefox ..


Modified: plog/trunk/class/view/admin/adminview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminview.class.php	2006-05-25 15:48:14 UTC (rev 3461)
+++ plog/trunk/class/view/admin/adminview.class.php	2006-05-25 17:28:59 UTC (rev 3462)
@@ -49,7 +49,11 @@
 			
 			// set the character set in the request based on the blog locale
 			$locale = $this->_blogInfo->getLocale();
-			$this->setCharset( $locale->getCharset());			
+			$this->setCharset( $locale->getCharset());
+			$this->addHeaderResponse( 'Cache-Control: no-cache, must-revalidate' );
+			$this->addHeaderResponse( 'Last-Modified: ' . gmdate( "D, d M Y H:i:s" ) . ' GMT' );
+			$this->addHeaderResponse( 'Expires: now' );
+			$this->addHeaderResponse( 'Pragma: no-cache' );
         }
         
         /**



More information about the pLog-svn mailing list