Clean cache with PHP code

Author Message

Emmanuel LOREAL

Sunday 22 March 2009 11:18:46 am

Hello,

I use ezPublish 4.0.1

I have created two actions for a guestbook module, ActionPublier and ActionNePasPublier, which change the is_publie attribute of my message_livre object from 2 to 0 or from 2 to 1.

My actions are in my content_actionhandler.php, they work fine, but after my objects are updated, i would like to refresh the view cache of the visitors page where the guestbook messages are displayed, so that the new published messages appear!

The nodeID of this page is 157 and the corresponding objectID is 160.

I have tried :

eZContentCache::cleanup( array( 157 ) );
eZContentObjectTreeNode::clearViewCacheForSubtree( 157, true );
eZContentCacheManager::clearObjectViewCache($objectID,true,array(157));
eZContentCacheManager::clearContentCache($objectID,true,array(157));
eZContentCacheManager::clearContentCache(160);
eZContentCacheManager::clearTemplateBlockCache(160);

But nothing refreshes the cache of the visitors page.
In the admin site acess, the object is refreshed, but not in the visitors site access.

What should i do?? heeeeeeeeeeeeeeeeeelppp! :)

Thankx.

meriam santos

Thursday 30 April 2009 4:50:45 pm

Hi,

Just want to ask if you were able to get the answet to this problem?

i also had the same problem. i have updated/deleted an object - i have 7 before then updated to 5 now. when i run my cronjob for deleting old nodes. it still says it found 7 items. where in fact i only have 5.

how can this be updated? do i need to compile the program - cronexpire.php?

please reply. just needed some answers..

thanks,
iam

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 14:57:34
Script start
Timing: Jan 18 2025 14:57:34
Module start 'layout'
Timing: Jan 18 2025 14:57:34
Module start 'content'
Timing: Jan 18 2025 14:57:35
Module end 'content'
Timing: Jan 18 2025 14:57:35
Script end

Main resources:

Total runtime1.0630 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.0059 589.0313152.6250
Module start 'layout' 0.00590.0038 741.656339.4453
Module start 'content' 0.00971.0516 781.1016460.8672
Module end 'content' 1.06130.0016 1,241.96888.1641
Script end 1.0629  1,250.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2782160.0002
Check MTime0.00120.1173160.0001
Mysql Total
Database connection0.00100.094010.0010
Mysqli_queries1.017395.7048540.0188
Looping result0.00060.0558520.0000
Template Total1.026596.620.5132
Template load0.00210.198320.0011
Template processing1.024496.367320.5122
Template load and register function0.00020.021610.0002
states
state_id_array0.00170.158810.0017
state_identifier_array0.00250.233420.0012
Override
Cache load0.00180.1682220.0001
Sytem overhead
Fetch class attribute can translate value0.00070.062520.0003
Fetch class attribute name0.00150.141220.0008
XML
Image XML parsing0.00030.032820.0002
class_abstraction
Instantiating content class attribute0.00000.000820.0000
General
dbfile0.00140.1321100.0001
String conversion0.00000.000940.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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs