Forums / Setup & design / Nodes NOT caching!

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

eZ debug

Timing: Jan 18 2025 16:25:21
Script start
Timing: Jan 18 2025 16:25:21
Module start 'content'
Timing: Jan 18 2025 16:25:22
Module end 'content'
Timing: Jan 18 2025 16:25:22
Script end

Main resources:

Total runtime0.8021 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.6094180.8438
Module start 'content' 0.00640.6424 768.4531603.1250
Module end 'content' 0.64880.1532 1,371.5781337.3984
Script end 0.8020  1,708.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4774210.0002
Check MTime0.00140.1795210.0001
Mysql Total
Database connection0.00060.073210.0006
Mysqli_queries0.723490.19392020.0036
Looping result0.00210.26542000.0000
Template Total0.768395.820.3841
Template load0.00190.242820.0010
Template processing0.766395.546020.3832
Template load and register function0.00020.028210.0002
states
state_id_array0.00230.289810.0023
state_identifier_array0.00160.201620.0008
Override
Cache load0.00160.2056410.0000
Sytem overhead
Fetch class attribute can translate value0.00130.163040.0003
Fetch class attribute name0.00110.136470.0002
XML
Image XML parsing0.00120.155540.0003
class_abstraction
Instantiating content class attribute0.00000.002080.0000
General
dbfile0.00270.3329340.0001
String conversion0.00000.001130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs