[Evocms-plugins-commits] SF.net SVN: evocms-plugins: [443] memcache_plugin/trunk/_memcache.plugin.
Brought to you by:
blueyed
From: <bl...@us...> - 2007-07-10 00:29:46
|
Revision: 443 http://svn.sourceforge.net/evocms-plugins/?rev=443&view=rev Author: blueyed Date: 2007-07-09 17:29:40 -0700 (Mon, 09 Jul 2007) Log Message: ----------- - Normalized X-MemCache headers - Removed check for "incomplete content", which should become and default-to-off option instead - Fixed possible E_FATAL with call to undefined $Debuglog Modified Paths: -------------- memcache_plugin/trunk/_memcache.plugin.php Modified: memcache_plugin/trunk/_memcache.plugin.php =================================================================== --- memcache_plugin/trunk/_memcache.plugin.php 2007-07-07 15:28:18 UTC (rev 442) +++ memcache_plugin/trunk/_memcache.plugin.php 2007-07-10 00:29:40 UTC (rev 443) @@ -270,7 +270,7 @@ if( $this->Settings->get('content_renew_on_reload') && $Hit->is_browser_reload() ) { // Force reload: - header( 'X-MemCache-Reload: Forced' ); + header( 'X-MemCache-Status: forced-reload' ); } else { // Try to serve from cache: @@ -280,7 +280,7 @@ { // Cache hit: $cached_meta = $this->MemCache->get( $this->pagecontent_meta_key ); - header( 'X-MemCache-Served-In: '.$Timer->get_duration( 'main.inc' ).'s' ); + header( 'X-MemCache: served-from-cache in '.$Timer->get_duration( 'main.inc' ).'s' ); if( ! $cached_meta ) { @@ -375,7 +375,7 @@ } // Cache miss: - header( 'X-MemCache-Hit: missed' ); + header( 'X-MemCache: cache-miss' ); } @@ -777,10 +777,13 @@ $this->pagecontent_save_meta_during_shutdown = false; - if( ! preg_match( '~(</html>|</rss>|</feed>)\s*$~i', $buffer ) ) - { // Avoid caching incomplete content + /* + TODO: make this an option and default to false. + if( ! preg_match( '~(</html>|</rss>|</feed>|</urlset>)\s*$~i', $buffer ) ) + { // Avoid caching incomplete content (urlset gets used by XML sitemaps) return $buffer; } + */ if( ! $this->MemCache->set( $this->pagecontent_payload_key, $buffer ) ) { @@ -940,7 +943,10 @@ { global $Debuglog; - $Debuglog->add( 'Setting «'.$key.'»', 'memcache' ); + if( isset($Debuglog) ) + { // this may not be set in the shutdown process + $Debuglog->add( 'Setting «'.$key.'»', 'memcache' ); + } if( $r = @parent::set( $this->_prefix.$key, $var, $this->_set_compress, $this->_set_expire ) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |