Changeset 17500
- Timestamp:
- 09/11/08 20:09:08 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.core/midcom/config/midcom_config.php
r17436 r17500 117 117 * 'revalidate' is the default which sets 'must-revalidate' and presses the issue by setting Expires to current time<br/> 118 118 * 'public' and 'private' enable caching with the cache-control header of the same name, default expiry timestamps are generated using the cache_module_content_default_lifetime 119 * - <b>int cache_module_content_default_lifetime:</b> How many seconds from now to set the default Expires header to, defaults to one minute 119 * - <b>int cache_module_content_default_lifetime:</b> How many seconds from now to set the default Expires header to, defaults to 15 minutes. Also used as default expiry time for content-cache entries that have no expiry set. 120 * - <b>string cache_module_content_headers_strategy_authenticated:</b> Defaults to 'private', this is equivalent to cache_module_content_headers_strategy but applies when we have authenticated user. 121 * - <b>int cache_module_content_default_lifetime_authenticated:</b> defaults to 0, equivalent to cache_module_content_default_lifetime but applies to authenticated users (except this does not set content-cache expiry). These two options are added to combat braindead proxies. 120 122 * - <b>string cache_module_content_caching_strategy:</b> Valid values are<br/> 121 123 * 'user' the "classic" mode, per user content-cache, default<br/> … … 353 355 $GLOBALS['midcom_config_default']['cache_module_content_headers_strategy'] = 'revalidate'; 354 356 $GLOBALS['midcom_config_default']['cache_module_content_headers_strategy_authenticated'] = 'private'; 355 $GLOBALS['midcom_config_default']['cache_module_content_default_lifetime'] = 60; // Seconds, added to gmdate() for expiry timestamp (in case no other expiry is set)357 $GLOBALS['midcom_config_default']['cache_module_content_default_lifetime'] = 900; // Seconds, added to gmdate() for expiry timestamp (in case no other expiry is set), also used as default expiry for content-cache entries that have no expiry set 356 358 $GLOBALS['midcom_config_default']['cache_module_content_default_lifetime_authenticated'] = 0; // as above but concerns only authenticated state 357 359 $GLOBALS['midcom_config_default']['cache_module_content_caching_strategy'] = 'user'; // Valid options are 'user' (default), 'memberships' and 'public' branches/MidCOM_2_8/midcom.core/midcom/services/cache/module/content.php
r17436 r17500 1003 1003 { 1004 1004 // Use default expiry for cache entry, most components don't bother calling expires() properly 1005 /* 1006 debug_push_class(__CLASS__, __FUNCTION__); 1007 debug_add("explicit expires is not set, using \$this->_default_lifetime: {$this->_default_lifetime}"); 1008 debug_pop(); 1009 */ 1005 1010 $entry_data['expires'] = time() + $this->_default_lifetime; 1006 1011 } … … 1008 1013 $entry_data['last_modified'] = $this->_last_modified; 1009 1014 $entry_data['sent_headers'] = $this->_sent_headers; 1015 /** 1016 * Remove comment to debug cache 1017 */ 1018 debug_push_class(__CLASS__, __FUNCTION__); 1019 debug_print_r("Writing meta-cache entry {$content_id}", $entry_data); 1020 debug_pop(); 1021 /* */ 1010 1022 $this->_meta_cache->open(true); 1011 1023 $this->_meta_cache->put($content_id, $entry_data); … … 1274 1286 if (!$this->_no_cache) 1275 1287 { 1276 $strategy = $this->_headers_strategy; 1277 $default_lifetime = $this->_default_lifetime; 1288 // Typecast to make copy in stead of reference 1289 $strategy = (string)$this->_headers_strategy; 1290 $default_lifetime = (int)$this->_default_lifetime; 1278 1291 if ( ( isset($_MIDCOM->auth) 1279 1292 && is_a($_MIDCOM->auth, 'midcom_services_auth') … … 1282 1295 ) 1283 1296 { 1284 $strategy = $this->_headers_strategy_authenticated; 1285 $default_lifetime = $this->_default_lifetime_authenticated; 1297 // Typecast to make copy in stead of reference 1298 $strategy = (string)$this->_headers_strategy_authenticated; 1299 $default_lifetime = (int)$this->_default_lifetime_authenticated; 1286 1300 } 1287 1301 switch($strategy)
