How to disable caching for a given template

Author Message

Chad Paulson

Saturday 12 January 2008 4:28:26 pm

I am working on an eZ Publish-based site which has caching disabled. We are running into issues where certain templates are still being cached and we want to make sure, 100%, that every time you view a certain template, it displays current data. I understand that even if you have caching disabled, eZ Publish will still cache certain views, roles, sessions, etc.

I ran across an article that explains how to turn off caching on the template level (URL below) and I was wondering if this solution would solve my caching problem.

My solution is to put the following piece of code in the first line of a given template we do not want cached (even if it is being included in another template).

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

Will this work as expected? Thanks in advance!

http://ez.no/ezpublish/documentation/incoming/how_to_set_cache_expire_time_or_disable_cache_in_template

André R.

Sunday 13 January 2008 2:12:35 am

There are several caches in eZ Publish the cache_ttl setting would only disable it on a node templates (the ones with content/view system url), it is known as 'view cache'.

http://ez.no/developer/forum/developer/user_parameters_cause_cache_trouble_solved
http://ez.no/developer/forum/setup_design/no_cache_settings_work

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

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:08:27
Script start
Timing: Jan 18 2025 16:08:27
Module start 'layout'
Timing: Jan 18 2025 16:08:27
Module start 'content'
Timing: Jan 18 2025 16:08:28
Module end 'content'
Timing: Jan 18 2025 16:08:28
Script end

Main resources:

Total runtime0.7836 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.0055 589.1641152.6406
Module start 'layout' 0.00550.0026 741.804739.4766
Module start 'content' 0.00800.7734 781.2813532.1328
Module end 'content' 0.78140.0021 1,313.41418.1250
Script end 0.7835  1,321.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4304160.0002
Check MTime0.00150.1873160.0001
Mysql Total
Database connection0.00090.120610.0009
Mysqli_queries0.738694.2642540.0137
Looping result0.00050.0585520.0000
Template Total0.757796.720.3788
Template load0.00210.267920.0010
Template processing0.755696.424620.3778
Template load and register function0.00010.013410.0001
states
state_id_array0.00080.108410.0008
state_identifier_array0.00150.195020.0008
Override
Cache load0.00160.2048150.0001
Sytem overhead
Fetch class attribute can translate value0.00090.114320.0004
Fetch class attribute name0.00130.163640.0003
XML
Image XML parsing0.00110.136720.0005
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00090.1189230.0000
String conversion0.00000.000940.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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs