Clearing cache after changing priority [solved]

Author Message

Atle Pedersen

Wednesday 21 March 2007 9:51:36 am

Hi!

After much pain and hard work I finally understood how to use viewcache.ini to clear cache for other nodes than the one I'm publishing new nodes under.

Hovewer there's still one problem with cache. I allow an editor to usa a homemade interface to change the priorities of certain objects, in order to sort them correctly. But changing priority/srot order does not seem to clear any cache.

Is there a sollution to this problem?

Kristian Hole

Wednesday 21 March 2007 9:58:23 am

Hi Atle,

If the viewcache is configured properly it should clear the viewcache when you are changing priorities.

If you are doing it from PHP, then you might need to use eZContentCacheManager::clearObjectViewCache to clear the view cache for your object.

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Atle Pedersen

Wednesday 21 March 2007 10:15:28 am

I'm trying to do this from a template using the following html and template code:

<form  method="post" action={"/content/action"|ezurl}>
<input type="text" name="Priority[]" size="3" value="{$person.priority}" title="" />
<input type="hidden" name="PriorityID[]" value="{$person.node_id}" />
<input type="hidden" name="ContentNodeID" value='{$listenid}' />
<input type="hidden" name="redirecthack" value="{$node.url_alias}" />
<input type="hidden" name="ContentObjectID" value='{$objecth[$listenid]}' />
<input type="submit" name="UpdatePriorityButton" value="Endre prioritet" title="Høyere prioritet vises tidligere" />
</form>
 

$listenid is a node id and $objecth[$listenid] is the objectid of the same node.

Atle Pedersen

Wednesday 21 March 2007 10:53:33 am

Ahh.. you put me on the right track, Kristian. Thanks.

I read the source code and found that ContentObjectID is used for clearing cache. So it was a matter of changing this variable.

<input type="hidden" name="ContentObjectID" value='{$node.object.id}' />

That was definitely the end of work for today. :)

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 30 2025 21:45:56
Script start
Timing: Jan 30 2025 21:45:56
Module start 'layout'
Timing: Jan 30 2025 21:45:56
Module start 'content'
Timing: Jan 30 2025 21:45:56
Module end 'content'
Timing: Jan 30 2025 21:45:56
Script end

Main resources:

Total runtime0.0211 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.2656151.2266
Module start 'layout' 0.00470.0034 739.4922220.7188
Module start 'content' 0.00810.0114 960.21091,001.8672
Module end 'content' 0.01950.0015 1,962.078133.9922
Script end 0.0211  1,996.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.6075140.0002
Check MTime0.00104.9103140.0001
Mysql Total
Database connection0.00073.117610.0007
Mysqli_queries0.002612.359830.0009
Looping result0.00000.047410.0000
Template Total0.00115.210.0011
Template load0.00094.150110.0009
Template processing0.00021.056210.0002
Override
Cache load0.00062.857810.0006
General
dbfile0.00021.104780.0000
String conversion0.00000.038440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs