Delete cache of a node that shows some objects

Author Message

Jerome Despatis

Wednesday 24 August 2011 3:55:50 am

Hello,

I have a page that performs a fetch of some objects

Of course, due to the view cache, whenever I manage those object, the page cache is not cleaned, and therefore is obsolete

=> How can I tell eZ to delete the cache of this node, whenever some objects of a specific class are modified ?

(This page/node has no relation with those objects, I use in the page the fetch('tree') template operator)

Hamdi Laadhari

Wednesday 24 August 2011 4:16:00 am

Have a look at the smartCacheClear feature of ezpublish

Certified eZ Publish Entreprise 4.5
http://www.laadhari.fr

Jerome Despatis

Wednesday 24 August 2011 4:46:49 am

Yes but what rule would you put ?

I have no relation between my page and the objects shown on it

Would be nice for me to tell eZ to expire all cache of a specific node whenever a new version of an object of a specific class is created

Daniel A. Øien

Wednesday 24 August 2011 5:54:19 am

You need to put the object ID of the node in the appropriate class section in settings/override/viewcache.ini.append.php. For example, if your node is an object of the article class:

[article]
DependentClassIdentifier[]=folder
DependentClassIdentifier[]=frontpage
ClearCacheMethod[]=object
ClearCacheMethod[]=parent
ClearCacheMethod[]=siblings
ClearCacheMethod[]=relating
AdditionalObjectIDs[]
AdditionalObjectIDs[]=xxxx

Also, you need to have smart Cache clearing enabled in settings/siteaccess/<your_admin_siteaccess>/viewcache.ini.append.php:

[ViewCacheSettings]
SmartCacheClear=enabled

Daniel A. Øien
Open Concept SA, Norway
Web: http://openconcept.no/
In English: http://openconcept.no/eng

Jerome Despatis

Wednesday 24 August 2011 9:55:26 am

Thanks Daniel,

I have a last problem: the page that performs some objects, shows objects AND also drafts

And as I can see on viewcache, the rules from viewcache.ini are followed for newly published object right ?

So I guess that even if I find the good setting for viewcache, whenever I create a draft, my page won't show those ones right ?

For now, I've disabled the cache for this page, as I haven't found a better option... tell me if I'm wrong!

with ViewCacheTweaks[236]=disabled

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

eZ debug

Timing: Jan 17 2025 23:47:25
Script start
Timing: Jan 17 2025 23:47:25
Module start 'layout'
Timing: Jan 17 2025 23:47:25
Module start 'content'
Timing: Jan 17 2025 23:47:25
Module end 'content'
Timing: Jan 17 2025 23:47:25
Script end

Main resources:

Total runtime0.0135 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.1641152.6406
Module start 'layout' 0.00460.0028 741.804739.4844
Module start 'content' 0.00740.0040 781.289193.4766
Module end 'content' 0.01140.0021 874.765634.2891
Script end 0.0135  909.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002215.9903140.0002
Check MTime0.00107.3509140.0001
Mysql Total
Database connection0.00075.094510.0007
Mysqli_queries0.002115.815830.0007
Looping result0.00000.111110.0000
Template Total0.001813.110.0018
Template load0.00107.031810.0010
Template processing0.00086.004110.0008
Override
Cache load0.00064.421110.0006
General
dbfile0.00021.843980.0000
String conversion0.00000.045840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs