Cache block

Author Message

Jacques Feix

Thursday 03 May 2007 6:19:36 am

Hi,
I would like to uncache a block in an article template as soon as an article is edited in the admin
I thought the cache-block was made for this but it doesn't work ...

 {cache-block expiry=1 keys=array($node.node_id,"articles_connexes")}
 .... my template to uncache ....
 {cache-block}

thx,

Atle Pedersen

Friday 04 May 2007 12:59:52 am

Hi,

cache-block is ment for use only in pagelayout.tpl.

When editing an existing article the view-cache for that article is automatically cleared.

In order to clear for other siteaccesses than the one the article is edited in, you need to associate these siteaccesses.

in site.ini.append for your admin siteaccess, add

[SiteAccessSettings]
RelatedSiteAccessList[]=thatothersiteaccess

Atle

Frédéric DAVID

Friday 04 May 2007 3:16:43 am

Hello,

If you want to uncache a block, you can put the follow line in your template.

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

In your example , you can put it in your article template.

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

Jacques Feix

Friday 04 May 2007 8:12:09 am

Yes it works with this

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

thx, Jacques

Xavier Dutoit

Saturday 05 May 2007 9:27:14 am

Salut,

Consider putting lots of content into cache-block and try using the expiry keys on the blocks (subtree, no Time expiry...)... otherwise, you might have performance problem (you don't use the normal cache anymore, you have to replace it by your own cache-block)

X+

http://www.sydesy.com

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

Main resources:

Total runtime0.7803 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.9219152.6094
Module start 'layout' 0.00470.0039 741.531339.3984
Module start 'content' 0.00850.7702 780.9297638.7422
Module end 'content' 0.77880.0015 1,419.671912.2031
Script end 0.7803  1,431.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4414160.0002
Check MTime0.00150.1863160.0001
Mysql Total
Database connection0.00050.064510.0005
Mysqli_queries0.718792.0971670.0107
Looping result0.00080.0997650.0000
Template Total0.746095.620.3730
Template load0.00250.317220.0012
Template processing0.743595.279520.3717
Template load and register function0.00020.025210.0002
states
state_id_array0.00090.109910.0009
state_identifier_array0.00140.181220.0007
Override
Cache load0.00200.2603330.0001
Sytem overhead
Fetch class attribute can translate value0.00090.114640.0002
Fetch class attribute name0.00100.123980.0001
XML
Image XML parsing0.00160.208640.0004
class_abstraction
Instantiating content class attribute0.00000.001880.0000
General
dbfile0.00100.1304280.0000
String conversion0.00000.001640.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/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: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs