Content cache problem in a template.

Author Message

Daniele Nocentini

Thursday 03 June 2010 5:59:07 am

I've a template with a list of file for download and I need to display the numbers of download for each file. I set in a first line of the template this:

{set-block scope=root variable=cache_ttl}0{/set-block}

but if I download a file and refresh the page, the number of download still zero but if I clean the content cache by admin interface and than refresh page in site the number of download of my file it's update.

How can I display the numbers of download every time the page was refreshed?

thanks.

Antica Bottega Digitale srl
http://www.abd.it

André R.

Thursday 03 June 2010 6:30:14 am

First, you need to use global scope, root only works if it is the first level template for the node view, and my guess is this is in a attribute template. So:

{set-block scope=global variable=cache_ttl}0{/set-block}

Second, make sure there are no cache-blocks surrounding this code in the same template or parent templates.

Third, do you really need to set it to 0? Isn't it enough that it updates every minute and so on? (60)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Daniele Nocentini

Thursday 03 June 2010 9:16:26 am

Hi Andrè thanks for your reply.

In the same template I have also a section that must be displayed only if a ezhttp template variable it's set but if I set cache_ttl to 600 this template section doesn't displayed when I click on this link:

{concat($node.url_alias, "?jolly=show")|ezurl}

{if ezhttp_hasvariable('jolly', 'get')}
{if eq(ezhttp('jolly', 'get'), 'show')}

.......

{/if}{/if}

Antica Bottega Digitale srl
http://www.abd.it

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

Main resources:

Total runtime0.7502 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.0060 588.0313152.6406
Module start 'layout' 0.00600.0036 740.671939.4609
Module start 'content' 0.00970.7390 780.1328545.9844
Module end 'content' 0.74860.0016 1,326.117212.1563
Script end 0.7502  1,338.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4438160.0002
Check MTime0.00130.1703160.0001
Mysql Total
Database connection0.00070.094210.0007
Mysqli_queries0.698393.0722570.0123
Looping result0.00060.0805550.0000
Template Total0.715895.420.3579
Template load0.00200.262120.0010
Template processing0.713895.149020.3569
Template load and register function0.00010.014710.0001
states
state_id_array0.00100.137810.0010
state_identifier_array0.00100.130220.0005
Override
Cache load0.00170.2222240.0001
Sytem overhead
Fetch class attribute can translate value0.00070.096720.0004
Fetch class attribute name0.00120.156750.0002
XML
Image XML parsing0.00100.133320.0005
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00190.2500230.0001
String conversion0.00000.001640.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/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/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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs