cache and users

Author Message

laurent le cadet

Wednesday 09 June 2010 5:24:38 am

Hi,

I have added an integer field to the user class definition.
I would like to display or not contents base on the value of this integer.

In pagelayout, i can read this value like this :
{$current_user.contentobject.data_map.credit.content}

This could be a cache key for contents in the mainarea but I'm not really sure if it's the good strategy.

Could someone tell me more about that, a bad cache manipulation can be very negative on performances.

Best regards.

Laurent

André R.

Wednesday 09 June 2010 6:58:57 am

If possible, use roles and policies (by using different user groups for instance) instead as they are supported by all caches (for cache blocks they are supported out of the box using $user_hash: http://svn.ez.no/svn/extensions/ezwebin/trunk/packages/ezwebin_extension/ezextension/ezwebin/design/ezwebin/templates/pagelayout.tpl)

But if you don't need to vary by this in the view of your content and just in pagelayout, then it shouldn't affect performance that much as you can use this variable as part of cache-block keys that are used around the section where you use it.

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

laurent le cadet

Wednesday 09 June 2010 7:05:44 am

André,

Roles and policies can't served me as users belongs to the same group.
Contents I want to change are in $module_result, full or line view, which is rather different as this is the view cache which is concerned.

Laurent

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

Main resources:

Total runtime0.0184 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.0065 589.1563153.4375
Module start 'layout' 0.00650.0039 742.593839.3594
Module start 'content' 0.01050.0053 781.953189.7578
Module end 'content' 0.01580.0025 871.710934.3047
Script end 0.0183  906.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002915.6390140.0002
Check MTime0.00137.2557140.0001
Mysql Total
Database connection0.00105.400510.0010
Mysqli_queries0.003217.366930.0011
Looping result0.00000.152010.0000
Template Total0.002010.710.0020
Template load0.00115.764310.0011
Template processing0.00094.871810.0009
Override
Cache load0.00073.939010.0007
General
dbfile0.00031.534380.0000
String conversion0.00000.059840.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