Forums / Developer / Nested cache-block(s)

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