expiry time not ignored in cache-block with subtree_expiry

Author Message

Marko Žmak

Friday 11 August 2006 2:52:15 am

I'm using some cache blocks on my site and I have setup them to use subtree_expiry. The blocks are cached ok, but after some time (i think 2 hour) the cache blocks are cleared although I haven't changed anything in the content of the site. I belive this is a bug since the docs says:

<i>In other words, it will implicitly turn on the "ignore_content_expiry" and set the expiration time to zero.</i>

(http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_functions/miscellaneous/cache_block)

I took a lok at the cache script (lib/eztemplate/classes/eztemplatecachefunction.php) and found out this code:

                    if ( isset( $functionParameters['subtree_expiry'] ) )
                    {
                        $ignoreContentExpiry = true;
                    }

There's also a $expiryTime variable in the code but it's not used anywhere related to 'subtree_expiry' parameter.

I think that the code should be this way:

                    if ( isset( $functionParameters['subtree_expiry'] ) )
                    {
                        $ignoreContentExpiry = true;
			$expiryTime = 0;
                    }
		    else
		    {
	                    $expiryTime = $localExpiryTime;
        	            if ( $ignoreContentExpiry == false )
	                    {
	                        include_once( 'lib/ezutils/classes/ezexpiryhandler.php' );
	                        $handler =& eZExpiryHandler::instance();
	                        if ( $handler->hasTimestamp( 'template-block-cache' ) )
	                        {
	                            $globalExpiryTime = $handler->timestamp( 'template-block-cache' );
	                            $expiryTime = max( $localExpiryTime, $globalExpiryTime );
	                        }
        	            }
		    }

Am I right?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Monday 14 August 2006 1:04:22 am

I reported this as a bug:

http://ez.no/bugs/view/8817

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 01:09:49
Script start
Timing: Jan 19 2025 01:09:49
Module start 'layout'
Timing: Jan 19 2025 01:09:49
Module start 'content'
Timing: Jan 19 2025 01:09:49
Module end 'content'
Timing: Jan 19 2025 01:09:49
Script end

Main resources:

Total runtime0.0206 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.4141152.6563
Module start 'layout' 0.00600.0032 742.070339.5078
Module start 'content' 0.00930.0094 781.578189.4297
Module end 'content' 0.01860.0020 871.007834.3047
Script end 0.0206  905.3125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.6159140.0002
Check MTime0.00115.1993140.0001
Mysql Total
Database connection0.00094.533510.0009
Mysqli_queries0.003516.949330.0012
Looping result0.00000.072810.0000
Template Total0.00157.210.0015
Template load0.00094.252610.0009
Template processing0.00062.899110.0006
Override
Cache load0.00062.700210.0006
General
dbfile0.00021.194180.0000
String conversion0.00000.048540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs