How to invalidate cache for one subtemplate

Author Message

Pierre Tissot

Friday 31 October 2008 8:58:41 am

Hi

I have a site where the products are Ez obejcts, but the price exist in other place, so I made a sub template price.tpl, where there is a custum fuction template made by me that is going to fecth the price elsewhere. The problem is that the cache is done for the entire set of template that build the page, and the command

{set-block scope=root variable=cache_ttl}0{/set-block}

invalidate not only my cache template, but all the contentView cache of this page. Is there any way of saying to easy: "Please don't cache this small block or template"?

thanks in advance
Pierre Tissot

André R.

Friday 31 October 2008 2:24:00 pm

Not possible.
I'm afraid you'll have to rethink your code logic, first: why do you need to disable the cache?
The price changes every second? If not consider setting ttl to something like 1 hour (3600) or 10 minutes (600).

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

Piotrek Karaś

Tuesday 18 November 2008 8:47:38 pm

Consider dynamic injection of data into cached template from a non-cached part of pagelayout with JavaScript.

--
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 11:46:12
Script start
Timing: Jan 18 2025 11:46:12
Module start 'layout'
Timing: Jan 18 2025 11:46:12
Module start 'content'
Timing: Jan 18 2025 11:46:12
Module end 'content'
Timing: Jan 18 2025 11:46:12
Script end

Main resources:

Total runtime0.7231 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.4766152.6406
Module start 'layout' 0.00530.0026 742.117239.4766
Module start 'content' 0.00790.7140 781.5938577.9453
Module end 'content' 0.72190.0012 1,359.539112.1250
Script end 0.7231  1,371.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4057160.0002
Check MTime0.00120.1653160.0001
Mysql Total
Database connection0.00090.118210.0009
Mysqli_queries0.677493.6729590.0115
Looping result0.00070.0994570.0000
Template Total0.696396.320.3482
Template load0.00190.266720.0010
Template processing0.694496.029720.3472
Template load and register function0.00030.035010.0003
states
state_id_array0.00070.102610.0007
state_identifier_array0.00090.127920.0005
Override
Cache load0.00160.2152170.0001
Sytem overhead
Fetch class attribute can translate value0.00130.173730.0004
Fetch class attribute name0.00160.225750.0003
XML
Image XML parsing0.00120.160030.0004
class_abstraction
Instantiating content class attribute0.00000.002250.0000
General
dbfile0.00080.1141240.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
3content/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
1content/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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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