Forums / Setup & design / Cache-block leading to Ez cache consistently serving dirty pages?

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

eZ debug

Timing: Jan 19 2025 01:15:23
Script start
Timing: Jan 19 2025 01:15:23
Module start 'content'
Timing: Jan 19 2025 01:15:24
Module end 'content'
Timing: Jan 19 2025 01:15:24
Script end

Main resources:

Total runtime0.9565 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.2266180.7969
Module start 'content' 0.00680.8047 770.0234478.4375
Module end 'content' 0.81150.1449 1,248.4609333.4688
Script end 0.9564  1,581.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4352210.0002
Check MTime0.00150.1542210.0001
Mysql Total
Database connection0.00130.136610.0013
Mysqli_queries0.877391.72881940.0045
Looping result0.00210.22301920.0000
Template Total0.928497.120.4642
Template load0.00220.227620.0011
Template processing0.926296.841120.4631
Template load and register function0.00020.020810.0002
states
state_id_array0.00140.149010.0014
state_identifier_array0.00120.127320.0006
Override
Cache load0.00190.1947280.0001
Sytem overhead
Fetch class attribute can translate value0.00160.162630.0005
Fetch class attribute name0.00180.189030.0006
XML
Image XML parsing0.00050.049530.0002
class_abstraction
Instantiating content class attribute0.00010.010030.0000
General
dbfile0.00200.2103210.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs