ViewCaching problem

Author Message

Nicolas Ottavi

Monday 26 June 2006 7:30:32 am

Hi there,

The site I am currently working on has a class named product.

Object of this class have several fields "price".

The price vary in function of the user groups.

If you are not logged in, prices are not displayed.
If you are logged in then, depending of the groups you belong to, a different price is displayed.

It works well ... when ViewCaching is disabled. When viewCaching is enabled (cause I was ready to move onto prod), as the view is cached, it doesn't update. So before finding a fine solution, I was thinking of disabling ViewCache only for object of the product class. But couldn't find how and could not figure out if it is possible ?

Any help ?

Thanks,
Nicolas

Ɓukasz Serwatka

Monday 26 June 2006 10:58:55 pm

You can disable view cache for that template and warp content which should be cache around {cache-blocks}.

Example:

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

Your price

{cache-block}
    Some cached content here
{/cache-block}

First line disable view cache for template.

http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_functions/miscellaneous/cache_block

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.