Changeset 17500

Show
Ignore:
Timestamp:
09/11/08 20:09:08 (3 months ago)
Author:
rambo
Message:

bitten by automatic references, clarified docblock

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/midcom.core/midcom/config/midcom_config.php

    r17436 r17500  
    117117 *   'revalidate' is the default which sets 'must-revalidate' and presses the issue by setting Expires to current time<br/> 
    118118 *   '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. 
    120122 * - <b>string cache_module_content_caching_strategy:</b> Valid values are<br/> 
    121123 *   'user' the "classic" mode, per user content-cache, default<br/> 
     
    353355$GLOBALS['midcom_config_default']['cache_module_content_headers_strategy'] = 'revalidate'; 
    354356$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 
    356358$GLOBALS['midcom_config_default']['cache_module_content_default_lifetime_authenticated'] = 0; // as above but concerns only authenticated state 
    357359$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  
    10031003            { 
    10041004                // 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                */ 
    10051010                $entry_data['expires'] = time() + $this->_default_lifetime; 
    10061011            } 
     
    10081013            $entry_data['last_modified'] = $this->_last_modified; 
    10091014            $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            /* */ 
    10101022            $this->_meta_cache->open(true); 
    10111023            $this->_meta_cache->put($content_id, $entry_data); 
     
    12741286        if (!$this->_no_cache) 
    12751287        { 
    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; 
    12781291            if (   (   isset($_MIDCOM->auth) 
    12791292                    && is_a($_MIDCOM->auth, 'midcom_services_auth') 
     
    12821295                ) 
    12831296            { 
    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; 
    12861300            } 
    12871301            switch($strategy)