Cache issue...

Author Message

Jorge estévez

Friday 23 October 2009 7:49:19 am

Hello,

I would like to do the following:

{def $current_user=fetch( user, current_user )}
{if $current_user.is_logged_in}	
           {def $basket=fetch( 'shop', 'basket' )}
            {if $basket.is_empty}
            		Do something (show image 1)
            {else}
           		Do something else (show image 2)
            {/if}
{else}
		Stay put
{/if}

The problem is that this code (for each product in a list) is inserted as a include into a “line/product.tpl” template.

The product list (with all the products) is cached, so images that should be displayed are not updated as they should, and keeps showing the same image since the last “clear cache”.

On the other hand the same code was added at the page_topbox.tpl and it works just fine.

I would like to try something like

<NO CACHE ATT ALL, ALWAYS PROCESS>
      The code
</NO CACHE ATT ALL, ALWAYS PROCESS>

Any other ideas welcomed.

By the way it’s an ez 3.10 website

Any help? thanks

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Gabriel Finkelstein

Monday 26 October 2009 10:41:18 am

Views are always cached by default. To change it, add

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

at the top of your tpl, and then a cache-block around the code you do want to get cached.

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

Main resources:

Total runtime0.8244 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.0057 588.9141152.6094
Module start 'layout' 0.00570.0034 741.523439.3984
Module start 'content' 0.00910.8141 780.9219523.4844
Module end 'content' 0.82310.0013 1,304.40638.2031
Script end 0.8244  1,312.6094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3806160.0002
Check MTime0.00130.1633160.0001
Mysql Total
Database connection0.00070.088810.0007
Mysqli_queries0.775794.0891540.0144
Looping result0.00060.0700520.0000
Template Total0.794496.420.3972
Template load0.00180.221120.0009
Template processing0.792596.133920.3963
Template load and register function0.00030.032010.0003
states
state_id_array0.00080.102210.0008
state_identifier_array0.00080.099020.0004
Override
Cache load0.00150.1815190.0001
Sytem overhead
Fetch class attribute can translate value0.00080.101920.0004
Fetch class attribute name0.00140.173130.0005
XML
Image XML parsing0.00070.085320.0004
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00090.1100160.0001
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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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