cache-block and custom node view

Author Message

laurent le cadet

Thursday 21 February 2008 1:57:53 am

Hi,

I did an override for folder depending on section :


[folder_annuaire_produits]
Source=node/view/full.tpl
MatchFile=full/annuaire_produits.tpl
Subdir=templates
Match[class_identifier]=folder
Match[section]=7

In this annuaire_produits.tpl, I fetch a tree of subfolders with products in them to print out a limited number of products sorted by published date (the very last new products) :

{def $products =   fetch('content','tree',hash( parent_node_id, $node.node_id,
                           'class_filter_type', 'include',
                           'class_filter_array', array('produit'),
                           'sort_by', array( 'published', false() ),
						   'limit', 9 ) )
				 
			}

{foreach $products as $product}
{node_view_gui view='embed' content_node=$product}
{/foreach}

At this point everything is ok...but not when there is a new product published in the subtree.
It doesn't appear in the last new product due to the standard cache mechanism.
I know there is a subtree cache function but I don't know how to write it.

I need some help.

Best reagrds.

Laurent

Maxime Thomas

Friday 22 February 2008 6:00:57 am

Hi,

You can set up eZ to automatically manage your cache with some specific content rules.
I think this article will be helpfull.

http://ez.no/doc/ez_publish/technical_manual/4_0/features/view_caching/smart_view_cache_cleaning

Cheers.

Max

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

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 20 2025 23:42:35
Script start
Timing: Jan 20 2025 23:42:35
Module start 'layout'
Timing: Jan 20 2025 23:42:35
Module start 'content'
Timing: Jan 20 2025 23:42:36
Module end 'content'
Timing: Jan 20 2025 23:42:36
Script end

Main resources:

Total runtime1.3229 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.2578152.0391
Module start 'layout' 0.00610.0023 741.296936.5938
Module start 'content' 0.00841.3137 777.8906561.1172
Module end 'content' 1.32200.0009 1,339.007811.8438
Script end 1.3229  1,350.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2764160.0002
Check MTime0.00140.1037160.0001
Mysql Total
Database connection0.00090.066310.0009
Mysqli_queries1.278096.6043540.0237
Looping result0.00060.0424520.0000
Template Total1.286897.320.6434
Template load0.00190.143020.0009
Template processing1.284997.122920.6424
Template load and register function0.00010.007910.0001
states
state_id_array0.00140.108910.0014
state_identifier_array0.00120.087720.0006
Override
Cache load0.00150.1155230.0001
Sytem overhead
Fetch class attribute can translate value0.00110.085520.0006
Fetch class attribute name0.00100.078140.0003
XML
Image XML parsing0.00120.093220.0006
class_abstraction
Instantiating content class attribute0.00000.000540.0000
General
dbfile0.00120.0905220.0001
String conversion0.00000.000540.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/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
2content/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: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs