Nodes NOT caching!

Author Message

Douglas Johnson

Tuesday 14 October 2003 7:31:47 am

All of my navigation (nodes) disappears with viewcaching enabled. NodeTreeCaching is enabled. Please help.

Alex Jones

Tuesday 14 October 2003 8:33:06 am

As per http://ez.no/developer/ez_publish_3/documentation/customization/custom_design/caching/variables_in_cached_templates

$node is not available with ViewCaching=enabled

$module_result is available with ViewCaching=enabled

You will need to update your code to avoid the use of $node in your navigation.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Douglas Johnson

Tuesday 14 October 2003 9:24:46 am

Here's what I'm using:

{let left_list=fetch( content, tree, hash(parent_node_id, $module_result.node_id, limit, 23,sort_by, array(modified,true()), class_filter_type, include, class_filter_array, array(2)))}
{section name=Leftmenu loop=$left_list}
{switch name=Sw1 match=$node.name}
{case match="About Metal-Fab"}
<a href={concat("/content/view/full/", $Leftmenu:item.node_id, "/")|ezurl}>
<br>{$Leftmenu:item.name}<br>
</a>
{/case}
{/switch}
{/section}
{/let}

This is not displayed when viewcach is enabled. Does this mean I will need to re-write all of my pagelayouts? If so, what is the code I should use?

Paul Borgermans

Tuesday 14 October 2003 12:16:28 pm

Try surrounding your pagelayout template "body" by

{let thisnode=fetch('content','node',hash('node_id',$module_result.node_id))}

.....replace $node with $thisnode .....

.....at the end of your template .....
{/let}

You can safely turn on viewcaching now

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Paul Borgermans

Tuesday 14 October 2003 12:21:19 pm

... in the template coding classroom:

Increase the speed by putting cache-blocks around your menus with the cache-block key array containing the current node id (and also the current user if you have roles for different users)

;-)

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

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

Main resources:

Total runtime0.0220 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.0092 588.9453152.6094
Module start 'layout' 0.00920.0039 741.554739.4141
Module start 'content' 0.01320.0067 780.968893.3047
Module end 'content' 0.01980.0021 874.273434.3047
Script end 0.0220  908.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003716.6542140.0003
Check MTime0.00125.5467140.0001
Mysql Total
Database connection0.00114.979110.0011
Mysqli_queries0.003716.754930.0012
Looping result0.00000.127810.0000
Template Total0.00177.610.0017
Template load0.00104.669410.0010
Template processing0.00062.866010.0006
Override
Cache load0.00073.393410.0007
General
dbfile0.00031.391880.0000
String conversion0.00000.045540.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