when and how to clear caches from php

Author Message

*- pike

Saturday 20 June 2009 2:53:36 pm

Hi

I'm using PHP to publish objects and new versions of objects.

Sometimes, this goes fine.
Sometimes, the changes dont show up in the admin until I clear the cache.

The changes are there - f.e. I can see 5 versions of an object in the version history, but just looking at the node in the admin shows me the first version.

In the code, after

$operationResult = eZOperationHandler::execute( 'content','publish',array( 
	'object_id' => $version->attribute( 'contentobject_id' ),
	'version' => $version->attribute( 'version' ) 
));

I call

eZContentCacheManager::clearContentCacheIfNeeded( 
	$version->attribute('contentobject_id'),
	$version->attribute('version') 
);

Apparently, that's not enough. What other caches must I clear (and how?)

thanks,
*-pike

---------------
The class eZContentObjectTreeNode does.

Heath

Monday 22 June 2009 2:46:00 pm

Great Topic *- pike,

Sad no one else posted before me.

Agreed! ez.no/doc should also include more documentation on what caches existing and how and when they are or should be cleared.

In general I think that ez.no/doc should offer more documentation on how and when to use the php api than is available currently.

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

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 18 2025 19:27:13
Script start
Timing: Jan 18 2025 19:27:13
Module start 'layout'
Timing: Jan 18 2025 19:27:13
Module start 'content'
Timing: Jan 18 2025 19:27:14
Module end 'content'
Timing: Jan 18 2025 19:27:14
Script end

Main resources:

Total runtime0.6800 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.1328152.6250
Module start 'layout' 0.00570.0031 741.757839.4453
Module start 'content' 0.00880.6697 781.2031527.6641
Module end 'content' 0.67850.0015 1,308.86728.4688
Script end 0.6800  1,317.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4628160.0002
Check MTime0.00130.1871160.0001
Mysql Total
Database connection0.00080.124310.0008
Mysqli_queries0.627992.3275540.0116
Looping result0.00050.0800520.0000
Template Total0.648995.420.3245
Template load0.00200.289820.0010
Template processing0.646995.132120.3235
Template load and register function0.00020.031510.0002
states
state_id_array0.00080.123810.0008
state_identifier_array0.00100.150920.0005
Override
Cache load0.00160.2332230.0001
Sytem overhead
Fetch class attribute can translate value0.00070.104020.0004
Fetch class attribute name0.00150.221930.0005
XML
Image XML parsing0.00060.089220.0003
class_abstraction
Instantiating content class attribute0.00000.001230.0000
General
dbfile0.00080.1162170.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
2content/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
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs