Cache-block leading to Ez cache consistently serving dirty pages?

Author Message

Tore Skobba

Wednesday 29 October 2003 8:35:35 am

Hi

I am developing an site where users should be allowed to log in and out. However, it seems that an cache-block function is destroying everything. This cache-block function seems to be documented in 3 lines, as such it is difficult to understand it. My main question is what does excatly an cache key do?

In my design I have an template which display the menu and a user panel (if anonymous user then a login and a register link, else logout and a edit(username) link). However, if I log in and out the user panel is not updated! I.e. an anonymous user has an link to edit(administrator user), the link is not working, but it should not be showing either. I thought this cache-block should make the cache work:

{cache-block keys=array($current_user.contentobject.id,'left_menu',$uri_string)}
{include uri="design:left_menu.tpl"}
{/cache-block}

I am trying to state that each $current_user must have their own content cached .

Hope someone have some tips on this

Tore

Vivienne van Velzen

Thursday 30 October 2003 1:15:28 am

Hi Tore,

Do you use a fetch to get the current_user? I.e. "current_user=fetch('user','current_user')".
I'm using this method as well to show different blocks for anonymous users and users who are logged in, and otherwise I can't see anything wrong with your code.
Greetings,

Vivienne

Tore Skobba

Thursday 30 October 2003 2:26:32 am

Hi

I do not use fetch to get the current user, this as I do not belive you need it, i.e. only {$current_user.contentobject.id} displays the id of the user. However, my stuff seems to work fine now, the reason might have been that I was editing the wrong cache block:

{cache-block keys=array('page_menu',$uri_string,$current_user.contentobject.id) }
{include uri="design:page_menu.tpl"}
{/cache-block}

Where page_menu.tpl is a template which first display menu links and sub menus. Then it imports another template which displays user info (login or log out etc.). This now seems to work very fine:)

But some docs on cache-block function would have been very nice.
Cheers
Tore

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 19 2025 04:17:53
Script start
Timing: Jan 19 2025 04:17:53
Module start 'layout'
Timing: Jan 19 2025 04:17:53
Module start 'content'
Timing: Jan 19 2025 04:17:53
Module end 'content'
Timing: Jan 19 2025 04:17:53
Script end

Main resources:

Total runtime0.6043 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.0054 593.4063152.6563
Module start 'layout' 0.00540.0033 746.062539.4922
Module start 'content' 0.00870.5940 785.5547473.3281
Module end 'content' 0.60270.0016 1,258.882812.0938
Script end 0.6043  1,270.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5447160.0002
Check MTime0.00130.2197160.0001
Mysql Total
Database connection0.00070.117310.0007
Mysqli_queries0.558792.4551570.0098
Looping result0.00070.1106550.0000
Template Total0.579295.820.2896
Template load0.00200.328120.0010
Template processing0.577295.515820.2886
Template load and register function0.00010.023810.0001
states
state_id_array0.00060.101910.0006
state_identifier_array0.00060.105120.0003
Override
Cache load0.00160.2637280.0001
Sytem overhead
Fetch class attribute can translate value0.00080.132020.0004
Fetch class attribute name0.00090.155630.0003
XML
Image XML parsing0.00020.037220.0001
class_abstraction
Instantiating content class attribute0.00000.001330.0000
General
dbfile0.00060.0913100.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/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: 16
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs