Invalidating an objects cache in PHP

Author Message

Paul Forsyth

Sunday 25 July 2004 12:52:29 pm

Is there an easy way to invalidate an object or nodes cache such that when it is next viewed the cache for it has to be rebuilt?

I have a case where im changing the attributes of some objects, which are displayed in the admin. After i store the attributes the main node view for that object doesnt update because of cache.

Is there a simple way to handle this?

paul

--
http://www.visionwt.com

Bård Farstad

Wednesday 18 August 2004 12:21:11 am

Hi Paul,

If you know the node id's you can use the following function to delete the view cache. The numbers in the array are node id's.

eZContentCache::cleanup( array( 42, 1024 ) );

--bård

Documentation: http://ez.no/doc

Paul Forsyth

Wednesday 18 August 2004 12:48:09 am

Excellent, thank you. I'll give this a try.

paul

--
http://www.visionwt.com

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 21:01:41
Script start
Timing: Jan 18 2025 21:01:41
Module start 'layout'
Timing: Jan 18 2025 21:01:41
Module start 'content'
Timing: Jan 18 2025 21:01:41
Module end 'content'
Timing: Jan 18 2025 21:01:41
Script end

Main resources:

Total runtime0.6471 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.0075 587.9375152.6250
Module start 'layout' 0.00750.0039 740.562539.4453
Module start 'content' 0.01140.6344 780.0078533.0859
Module end 'content' 0.64580.0013 1,313.09388.1563
Script end 0.6471  1,321.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5443160.0002
Check MTime0.00150.2360160.0001
Mysql Total
Database connection0.00110.165310.0011
Mysqli_queries0.596392.1504570.0105
Looping result0.00060.0939550.0000
Template Total0.611294.420.3056
Template load0.00200.306320.0010
Template processing0.609294.134820.3046
Template load and register function0.00020.025810.0002
states
state_id_array0.00090.141710.0009
state_identifier_array0.00090.132220.0004
Override
Cache load0.00160.2518200.0001
Sytem overhead
Fetch class attribute can translate value0.00070.110020.0004
Fetch class attribute name0.00140.215440.0003
XML
Image XML parsing0.00080.116820.0004
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00080.1187170.0000
String conversion0.00000.001540.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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs