Forums / Developer / Delete cache of a node that shows some objects

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

eZ debug

Timing: Jan 17 2025 21:01:40
Script start
Timing: Jan 17 2025 21:01:40
Module start 'content'
Timing: Jan 17 2025 21:01:41
Module end 'content'
Timing: Jan 17 2025 21:01:41
Script end

Main resources:

Total runtime1.0213 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 596.1797180.8203
Module start 'content' 0.00560.9129 777.0000635.7891
Module end 'content' 0.91860.1027 1,412.7891337.6016
Script end 1.0212  1,750.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4198210.0002
Check MTime0.00160.1568210.0001
Mysql Total
Database connection0.00070.063910.0007
Mysqli_queries0.948792.88772020.0047
Looping result0.00160.15432000.0000
Template Total0.993397.320.4966
Template load0.00240.233020.0012
Template processing0.990997.021120.4954
Template load and register function0.00020.014910.0002
states
state_id_array0.00090.084610.0009
state_identifier_array0.00130.125720.0006
Override
Cache load0.00210.2057400.0001
Sytem overhead
Fetch class attribute can translate value0.00160.158940.0004
Fetch class attribute name0.00140.133060.0002
XML
Image XML parsing0.00220.219840.0006
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00310.2993270.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs