Cache not cleared on start page when publish

Author Message

Ekkehard Dörre

Tuesday 13 December 2005 1:22:12 am

Hi,

There is a start page, which collects information from subfolders. It is called News and collects information with a modified folder.tpl: folder_start_news_de.tpl and fetch tree. So viewmode is "full" of {$module_result.content} and cached.

If I publish a new news, this node isn't cleared. If I publish via wait until date, same procedure. Other lists are cleared, but they are direct in pagelayout.tpl and not accessed via content/view/full

On possibility is to reduce caching time, which is bad for a start page

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

or this?

<b>Subtree Expiry</b>

Something inbetween the default policy of always expiring the cache blocks when content is published, and the functionality of "ignore_content_expiry" is the Subtree Expiry parameter. With this parameter you can control the expiration of a cache block when content in a specific subtree (like /products) is published. A real-life example might be where there is a block inside the pagelayout template which contains a list of the five last added products; in the following example the cache-block will be expired when there is something published in the /products/bargain subtre, or after 30 minutes:

{cache-block expiry=1800 subtree_expiry=/producs/bargain}

... tpl code

{/cache-block}

Which is the best way? There is a lot of traffic on this page.

Thanks, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Paul Forsyth

Tuesday 13 December 2005 1:36:19 am

If you disable the cache for the start page perhaps consider adding cache-blocks in those places that dont need to change? That way you can retain the dynamic fetch but cache everything else?

paul

Xavier Dutoit

Tuesday 13 December 2005 1:40:32 am

Doesn't work with the smart cache ?

if you enable the smart cache and says that everytime a new article (or whatever is published on the home page), you clear the cache of the home page, doesn't it work ?

Just remember that you have to put objects id, not node ids.

X+

http://www.sydesy.com

Ekkehard Dörre

Tuesday 13 December 2005 2:41:34 am

@Paul dynamic fetch is too heavy, but cache for 10 min is a possibility but not very elegant.

@Xavier
From
http://ez.no/products/ez_publish_cms/documentation/incoming/smart_viewcache_cleaning_system

[forum_reply]
DependentClassIdentifier[]
DependentClassIdentifier[]=folder
ClearCacheMethod=clear_object_and_relating_objects_caches
MaxParents=3;

#If 'Forum folder' has object_id=56 for example then the rule above can be more hard by adding next lines:
ObjectFilter[]
ObjectFilter[]=56

looks like a solution, but there is an unique fetch in viewmode full in folder and nothing related. Does this work, too?

Thanks, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Paul Forsyth

Tuesday 13 December 2005 3:07:33 am

Maybe we need a template operator to clear the cache of a node. The eZ api has this. So, in the pagelayout something like:

{if $some_condition}
{clear_cache_object(X)}
{/if}

may work if something can be tested.

Having a delay of 10 minutes isnt too bad. It means for most hits the cache will be in place and is fast. Fine tuning the time would be key.

btw, i added a relevant enhancment some time ago:

http://ez.no/community/bugs/smarter_viewcache

Paul

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