{cache-block subtree_expiry =/PARENT} does not work.

Author Message

Jacks JNK

Monday 17 November 2008 2:48:51 am

Indeed, I want to change each node of a parent's "articles" that the cache is emptied

{cache-block  subtree_expiry='/PARENT'}

{def  $articles=fetch( content, list,hash(parent_node_id,239,limit,5,
									 									 class_filter_type,'include',
									 									 class_filter_array,array('article'),
									 			 						 'sort_by',array('published',true())) )}

	{foreach $articles as $article}
					
				<div class="menu1">
					
			<a href={$article.url_alias|ezurl}>{$article.name}</a>
				</div>
									
	{/foreach}	
	{undef $articles}	
{/cache-block }

Skype : jacks_ngala

André R.

Monday 17 November 2008 7:15:07 am

Use the node id instead, less prone for errors.
{cache-block subtree_expiry=239}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jacks JNK

Tuesday 18 November 2008 12:40:51 am

it does not work !

Skype : jacks_ngala

Piotrek Karaś

Tuesday 18 November 2008 8:23:39 pm

I've never seen/heard of this /PARENT option. Has it ever worked?
If so, how does it work for non-node templates?

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Jacks JNK

Thursday 20 November 2008 2:06:06 am


no, it's just an illustration

Skype : jacks_ngala

André R.

Thursday 20 November 2008 5:53:19 am

what version are you on?
There is a bug in 4.0(and 3.10) that was fixed in 4.0.1 in regards to this.

@Piotrek: Do you remember witch issue? I remember you and kc identified it and made some test cases.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jacks JNK

Thursday 20 November 2008 6:14:58 am


I have version 4.0.1 I think this bug persists until now !!!!

Skype : jacks_ngala

Piotrek Karaś

Thursday 20 November 2008 6:29:44 am

So far we haven't seen any weird behavior from cache-blocks in 4.0.1 (or since 4.0.0 patch).

Meanwhile, I only joined this thread because I thought there was a cache-block feature that I hadn't known about. But that's not the case. So before we rush into solving the problem, could we please have problem explained once again? Because I sincerely have no idea what Jacks' problem is and what he/she is trying to accomplish. Especially, I don't understand that parent reference...

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Jacks JNK

Thursday 20 November 2008 6:42:24 am

The parent is just the name of the attribute (node) containing my articles on what I am used cache. example:
You have an object "ARTICLES" and children "Article 1, Article 2 ,...) published in" ARTICLES ". So it has nothing with the internal workings of eZ

Skype : jacks_ngala

Piotrek Karaś

Thursday 20 November 2008 6:48:44 am

Well, that part is clear. Now what are you trying to achieve and how is cache related?

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Jacks JNK

Thursday 20 November 2008 6:56:53 am

I want enabled the cache-block which will expire when an object is published or modified in the parent node.

Skype : jacks_ngala

Piotrek Karaś

Thursday 20 November 2008 7:14:43 am

Still, to few details. For example - if you're trying to put those cache-blocks inside node templates - have you disabled viewcache?

Anyways, here you'll find my tests: http://issues.ez.no/12175

And here's a newer version:

{def $subtree_expiry_node_id=61}
{def $expiry_seconds=60}
<table>
<tr><th colspan="2">Current time: {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )}, Expiry={$expiry_seconds}, Subree expiry={$subtree_expiry_node_id}</th></tr>
<tr><th>STANDARD</th><th>WITH KEYS</th></tr>
<tr><td>
    {cache-block expiry=0}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}cache-block expiry=0{rdelim}
    {/cache-block}
    </td><td>
    {cache-block expiry=0 keys=array( $uri_string )}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}cache-block expiry=0 keys=array( $uri_string ){rdelim}
    {/cache-block}
</td></tr><tr><td>
    {cache-block ignore_content_expiry expiry=0}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}ignore_content_expiry expiry=0{rdelim}
    {/cache-block}
    </td><td>
    {cache-block ignore_content_expiry expiry=0 keys=array( $uri_string )}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}ignore_content_expiry expiry=0 keys=array( $uri_string ){rdelim}
    {/cache-block}
</td></tr><tr><td>
    {cache-block expiry=$expiry_seconds}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}expiry={$expiry_seconds}{rdelim}
    {/cache-block}
    </td><td>
    {cache-block expiry=$expiry_seconds keys=array( $uri_string )}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}expiry={$expiry_seconds} keys=array( $uri_string ){rdelim}
    {/cache-block}
</td></tr><tr><td>
    {cache-block ignore_content_expiry expiry=$expiry_seconds}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}ignore_content_expiry expiry={$expiry_seconds}{rdelim}
    {/cache-block}
    </td><td>
    {cache-block ignore_content_expiry expiry=$expiry_seconds keys=array( $uri_string )}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}ignore_content_expiry expiry={$expiry_seconds} keys=array( $uri_string ){rdelim}
    {/cache-block}
</td></tr><tr><td>
    {cache-block subtree_expiry=$subtree_expiry_node_id}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}subtree_expiry={$subtree_expiry_node_id}{rdelim}
    {/cache-block}
    </td><td>
    {cache-block subtree_expiry=$subtree_expiry_node_id keys=array( $uri_string )}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}subtree_expiry={$subtree_expiry_node_id} keys=array( $uri_string ){rdelim}
    {/cache-block}
</td></tr><tr><td>
    {cache-block subtree_expiry=$subtree_expiry_node_id expiry=$expiry_seconds}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}subtree_expiry={$subtree_expiry_node_id} expiry={$expiry_seconds}{rdelim}
    {/cache-block}
    </td><td>
    {cache-block subtree_expiry=$subtree_expiry_node_id expiry=$expiry_seconds keys=array( $uri_string )}
    {currentdate()|datetime( 'custom', '%Y-%m-%d %H:%i:%s' )} {ldelim}subtree_expiry={$subtree_expiry_node_id} expiry={$expiry_seconds} keys=array( $uri_string ){rdelim}
    {/cache-block}
</td></tr></table>

As far as I can see - things work fine.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

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 18 2025 16:24:22
Script start
Timing: Jan 18 2025 16:24:22
Module start 'layout'
Timing: Jan 18 2025 16:24:22
Module start 'content'
Timing: Jan 18 2025 16:24:23
Module end 'content'
Timing: Jan 18 2025 16:24:23
Script end

Main resources:

Total runtime0.9424 sec
Peak memory usage4,096.0000 KB
Database Queries86

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.0469152.6406
Module start 'layout' 0.00680.0029 740.687539.4766
Module start 'content' 0.00970.9313 780.1641706.4141
Module end 'content' 0.94100.0014 1,486.578132.1250
Script end 0.9424  1,518.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3669160.0002
Check MTime0.00140.1507160.0001
Mysql Total
Database connection0.00080.084110.0008
Mysqli_queries0.859691.2134860.0100
Looping result0.00070.0718840.0000
Template Total0.911996.820.4559
Template load0.00230.241520.0011
Template processing0.909696.514920.4548
Template load and register function0.00010.010510.0001
states
state_id_array0.00070.069510.0007
state_identifier_array0.00100.101620.0005
Override
Cache load0.00200.2164510.0000
Sytem overhead
Fetch class attribute can translate value0.00050.054930.0002
Fetch class attribute name0.00140.1455150.0001
XML
Image XML parsing0.00150.156030.0005
class_abstraction
Instantiating content class attribute0.00010.0054240.0000
General
dbfile0.00120.1226300.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
12content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 47
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs