Cache-block and dynamic pages

Author Message

Olav Bringedal

Wednesday 14 September 2005 3:54:36 am

Im trying to get better caching of the site im building.

I figured that wrapping {$module_result.content} with {cache-block keys=$uri_string} in pagelayout.tpl was a great way. That was until I realized that this would not take offset of folder teplates into account. So i made it
{cache-block keys=array($uri_string, $view_parameters.offset}, which worked reasonably well.

However problem is that it caches things like basket, custom modules, user profile so it becomes pretty useless on my site.

Can anyone offer any experiences with this kind of caching?, and if there is a way to override it for certain classes/nodes/urls?


Senior Consultant
http://Umoe-consulting.no

Olav Bringedal

Wednesday 14 September 2005 4:51:38 am

Ugly, but this seems to work :)

{section show=$module_result.uri|eq('/news/shop/basket')}
     {$module_result.content}
{section-else}
     {cache-block keys=array($uri_string, $view_parameters.offset)}
     {$module_result.content}
     {/cache-block}
{/section}


Senior Consultant
http://Umoe-consulting.no

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:10:00
Script start
Timing: Jan 18 2025 16:10:00
Module start 'layout'
Timing: Jan 18 2025 16:10:00
Module start 'content'
Timing: Jan 18 2025 16:10:01
Module end 'content'
Timing: Jan 18 2025 16:10:01
Script end

Main resources:

Total runtime0.7131 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.9141152.6250
Module start 'layout' 0.00670.0030 740.539139.4453
Module start 'content' 0.00980.7019 779.9844487.5938
Module end 'content' 0.71170.0014 1,267.57818.1641
Script end 0.7131  1,275.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4483160.0002
Check MTime0.00130.1863160.0001
Mysql Total
Database connection0.00140.191810.0014
Mysqli_queries0.669593.8822520.0129
Looping result0.00040.0620500.0000
Template Total0.680095.420.3400
Template load0.00170.244420.0009
Template processing0.678395.113820.3391
Template load and register function0.00010.016910.0001
states
state_id_array0.00130.179610.0013
state_identifier_array0.00180.249320.0009
Override
Cache load0.00140.1960130.0001
Sytem overhead
Fetch class attribute can translate value0.00080.111910.0008
Fetch class attribute name0.00110.158030.0004
XML
Image XML parsing0.00060.078810.0006
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00090.1296160.0001
String conversion0.00000.001340.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
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs