Forums / Developer / when and how to clear caches from php

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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

7x | https://se7enx.com/
Brookins Consulting | https://brookinsconsulting.com/
Certified | http://web.archive.org/web/201012...th.ez.no/certification/verify/380350
Solutions | https://projects.exponential.earth/users/community/brookins-consulting
eZpedia community documentation project | http://ezpedia.se7enx.com