module_result for a specific attribute

Author Message

Pierre Tissot

Thursday 18 October 2007 8:31:10 am

Hi,

I have a site that is user custom attribute dependent, for the cache block I don't have any trouble, I use like this and works well for each user:

{cache-block keys=array($current_user.contentobject.data_map.mysetting.content)}
.......
{/cache-block} 

The problem is regarding the view cahe in {$module_result}, all the users have the same group and permissions, so I guess that it's why once the cache is build all the users will shares the same setting....and this is wrong for my site.
Is that possible to control view cache like we do with cache-blocks? Or like we do to user country or user currency but this time with a custom attribute?

Thx
PiR

Damien Pobel

Thursday 18 October 2007 11:00:43 am

Hi Pierre,

You have 2 solutions :
1. insert a {set-block scope=rot variable=cache_ttl}0{/set-block} to disable ViewCache in view templates and then put a cache-block instead. cache-block performs less than ViewCache but it's better than no cache at all
2. ViewCache is based on user's roles. Same roles give same cache file so if you change role for some users, they will get another cache file. Perhaps it's not possible in your case.

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Ɓukasz Serwatka

Friday 19 October 2007 7:43:38 am

You did not write in details about functionality you need, but looks it should be possible to use ezpreference() which works fine with view cache enabled.

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/data_and_information_extraction/ezpreference

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 31 2025 06:24:36
Script start
Timing: Jan 31 2025 06:24:36
Module start 'layout'
Timing: Jan 31 2025 06:24:36
Module start 'content'
Timing: Jan 31 2025 06:24:36
Module end 'content'
Timing: Jan 31 2025 06:24:36
Script end

Main resources:

Total runtime0.0145 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.2500151.2266
Module start 'layout' 0.00480.0027 739.476636.6641
Module start 'content' 0.00740.0057 776.140690.2656
Module end 'content' 0.01310.0014 866.406333.9922
Script end 0.0145  900.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002114.7445140.0002
Check MTime0.00106.8208140.0001
Mysql Total
Database connection0.00064.309810.0006
Mysqli_queries0.003020.657830.0010
Looping result0.00000.068910.0000
Template Total0.00107.010.0010
Template load0.00085.404510.0008
Template processing0.00021.514810.0002
Override
Cache load0.00053.454710.0005
General
dbfile0.002215.036780.0003
String conversion0.00000.047640.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