Forums / Developer / Cache block

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