Avoiding caching within a subtree?

Author Message

Clemens T

Thursday 07 February 2008 12:06:29 am

Hello all,

I'm having the following issue. When creating new users through PHPcode in a node in the Users tree via an extension the subtree of the node where that user is created in, is never cleared from cache. Right now I have to do this manually, to make sure the latest data is available to the users. Is it possible to do a cache refresh after every user I create in my code, or is it better to avoid caching at all on this subtree? If so: how?

Thanks!!
Clemens

Ɓukasz Serwatka

Friday 08 February 2008 12:55:57 am

Hi,

I assume that you know that subtree ID. then in PHP you can just clear view cache like:

eZContentCache::cleanup( array( $nodeID ) );

Remember include that class.

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

Clemens T

Tuesday 12 February 2008 1:11:23 am

Great stuff!! That's it. Works like a charm :).

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 19 2025 01:00:27
Script start
Timing: Jan 19 2025 01:00:27
Module start 'layout'
Timing: Jan 19 2025 01:00:27
Module start 'content'
Timing: Jan 19 2025 01:00:28
Module end 'content'
Timing: Jan 19 2025 01:00:28
Script end

Main resources:

Total runtime0.6639 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.1641152.6250
Module start 'layout' 0.00510.0043 741.789139.4609
Module start 'content' 0.00940.6530 781.2500534.8125
Module end 'content' 0.66240.0014 1,316.06258.1563
Script end 0.6638  1,324.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.4567160.0002
Check MTime0.00120.1876160.0001
Mysql Total
Database connection0.00070.102010.0007
Mysqli_queries0.614492.5511570.0108
Looping result0.00080.1140550.0000
Template Total0.634695.620.3173
Template load0.00150.229120.0008
Template processing0.633195.365920.3165
Template load and register function0.00010.019710.0001
states
state_id_array0.00090.141910.0009
state_identifier_array0.00070.101420.0003
Override
Cache load0.00130.1932150.0001
Sytem overhead
Fetch class attribute can translate value0.00270.406420.0013
Fetch class attribute name0.00180.267740.0004
XML
Image XML parsing0.00080.121020.0004
class_abstraction
Instantiating content class attribute0.00000.001640.0000
General
dbfile0.00080.1183180.0000
String conversion0.00000.001840.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs