Forums / Setup & design / Problem with cache

Problem with cache

Author Message

Aurélie Beaumont

Thursday 02 April 2009 7:00:21 am

Hi,

on the home page of my web site I want to put an event (the latest). For this, I use fetch function in my template. Here is an extract of my code that shows the event:

<a href={$event.url_alias|ezurl()}>
{if gt($event.data_map.title.content|count_chars(),60)}
{$event.data_map.title.content|shorten(60)}
{else}
{$event.data_map.title.content}
{/if}
</a>
<br />
{$event.data_map.from_time.content.timestamp|datetime( 'custom', '%l %j %F %Y' )}

The problem is : when I modifie the event or when I publish an event more recent, I MUST clean cache to view modifications on the home page.

Do you have a solution?

Thanks.

Łukasz Serwatka

Thursday 02 April 2009 7:49:56 am

Did you configure viewcache.ini rules correctly? Could you paste your settings?

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

Aurélie Beaumont

Thursday 02 April 2009 8:31:36 am

My settings in viewcache.ini.append.php :

[ViewCacheSettings]
ClearRelationTypes[]=common
ClearRelationTypes[]=reverse_common
ClearRelationTypes[]=reverse_embedded
ClearRelationTypes[]=reverse_attribute
SmartCacheClear=enabled

[communique]
DependentClassIdentifier[]=master_communique
DependentClassIdentifier[]=master_financial_communique
ClearCacheMethod[]=object
ClearCacheMethod[]=parent
ClearCacheMethod[]=relating

[event]
DependentClassIdentifier[]=master_evenement
ClearCacheMethod[]=object
ClearCacheMethod[]=parent
ClearCacheMethod[]=relating

I want objets of type "communique" and "event" to be refresh automatically in home page.

"master_communique", "master_financier_communique" and "master evenement" are parent pages that contain my news.