Share » Forums » Developer » uncache elements

uncache elements

uncache elements

Tuesday 26 July 2011 3:14:46 am - 3 replies

Author Message

Gaetano Giunta

Tuesday 26 July 2011 3:52:26 am

The problem is, I guess, that you are using your line_oi.tpl inside another node view template.

The caching basics in eZ is: the "view cache", part of the "content cache" stores one html chunk per node, when the page is accessed. The view cache is expired only when the node is edited, its children are edited, or related objects are edited.

Otoh the pagelayout (and templates included from it) is executed on every access.

Cache blocks are generally used to compensate this, eg. not to calculate on every page view the navigation menus, since they do not change frequently.

If you want to have a node view template that displays differently based upon some session variable for the user, you should in the first place deactivate the view cache for that node using this code:

{set-block scope=global variable=cache_ttl}XXX{/set-block}

(with XXX seconds), and only then think about introducing cache blocks.

More info:

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Features/View-caching

Principal Consultant International Business
Member of the Community Project Board

Nicolas Pastorino

Tuesday 26 July 2011 3:56:34 am

Hi Olivier, and welcome to the eZ Community, 

I am not sure whether you purposely simplified the code, but the {if} condition is missing the actual condition. Secondly : what type of data is stored in the session variable called 'carnet' ? An array ? A string ? Integer ?

Let us know,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Olivier Leloup

Tuesday 26 July 2011 7:58:20 am

Hi,

Thank you, the problem is solved.

I had other cache-block on other template (line_search_form.tpl).

Full_rubrique called Line_Search_Form and it called line_oi.

-_-'

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu