Nested cache-block(s)

Author Message

Nabil Alimi

Monday 10 July 2006 8:23:58 am

Hi,

What is the current behaviour of nested cache-blocks ?

I've read in the documentation that cache-blocks could (and should) be nested if there was too many of them.

So I expected the nested cache-blocks to each act on their own, respecting their own expiry rules.

But it doesnt seem so.

Here is some example :

{cache-block keys=array( 'list_of_blocks' , $list_identifier )}

{def $array_of_blocks = fetch( 'stuff' , 'mypreciouscontent' )}
    Some Dynamical stuff here.
    {foreach $array_of_blocks as $one_block}
    {cache-block keys=array( $one_block.$identifier , fetch( current_user , user ).is_logged_in subtree_expiry=$one_block.specific_expiry_path}
        Some templating here.
    {/cache-block}
    {/foreach}

{/cache-block}

So I expected <b>{cache-block keys=$one_block.$identifier subtree_expiry=$one_block.specific_expiry_path}</b> to expire once content was published or when the user switches from anonymous to logged_in. But it seems not...

Did I miss something ?

Thanks in advance.

Nabil.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Vjeran Vlahovic

Monday 10 July 2006 8:39:29 am

Hi Nabil,
AFAIK nested cache-blocks do not act on their own. Second (nested) cache block will be executed only after the parent cache block expires.

http://www.netgen.hr/eng

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 21 2025 04:23:13
Script start
Timing: Jan 21 2025 04:23:13
Module start 'layout'
Timing: Jan 21 2025 04:23:13
Module start 'content'
Timing: Jan 21 2025 04:23:13
Module end 'content'
Timing: Jan 21 2025 04:23:13
Script end

Main resources:

Total runtime0.0168 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.0054 590.9922151.1953
Module start 'layout' 0.00540.0027 742.187536.6172
Module start 'content' 0.00810.0069 778.804790.2500
Module end 'content' 0.01500.0017 869.054733.9922
Script end 0.0167  903.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003017.8187140.0002
Check MTime0.00116.4783140.0001
Mysql Total
Database connection0.00074.310410.0007
Mysqli_queries0.002615.652130.0009
Looping result0.00000.096710.0000
Template Total0.00137.510.0013
Template load0.00105.825810.0010
Template processing0.00031.663310.0003
Override
Cache load0.00063.757410.0006
General
dbfile0.001710.298380.0002
String conversion0.00000.203340.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