Forums / Developer / Optimizing view cache with logged in user

Optimizing view cache with logged in user

Author Message

Matthieu Sévère

Thursday 10 December 2009 6:14:35 am

Hello !

For an Extranet I am trying to improve general performances of the website. My main problem is that the view cache is re-generated for every user and every user is different (because there are logged in).

Do you have any ideas how to configure the view cache so that it is the same for every user ?

Thanks !

--
eZ certified developer: http://ez.no/certification/verify/346216

Damien Pobel

Thursday 10 December 2009 6:48:15 am

My main problem is that the view cache is re-generated for every user and every user is different (because there are logged in).

In fact, this is partly wrong (with the default settings). the view cache is shared between users that have the same roles. In other words, two users with the same rights will use the same view cache file unless you set some ViewCacheTweaks settings in site.ini/[ContentSettings] (see settings/site.ini for some details)

Anyway, to optimize your site you can try to nest cache-block in view templates or in existing cache-block to cache parts that do not depend on the user rights so generation of new cache files uses parts that are already generated.

You can also try to improve performances at the front end side because the load all the stuff around a page (CSS, image, JS, ...) usually takes 80% of the page load time felt by the user.

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

Frédéric DAVID

Thursday 10 December 2009 6:51:27 am

Hello,

You can configure the view cache.

In the file site.ini, you have a variable ViewCacheTweaks in section ContentSettings

For the key global, you can add some parameters in the array, like ignore_view_parameters.

[ContentSettings]
ViewCacheTweks[global]=ignore_userroles;ignore_userlimitedlist.

You have a parameter "pr_user". Maybe this parameter can resolve your problem.

Best Regards

Blog : http://www.frefred.fr/blog/ez-publish
feZ Meta Data : http://projects.ez.no/fezmetadata

Matthieu Sévère

Thursday 10 December 2009 6:58:23 am

That's great, thank you both of you !

@dpobel : front side is already optimized ( ezjscore packing for css and js, png optimization, mod_deflate and mod_gzip on, .. :-) )

I try these tweaks and tell you more ;-)

--
eZ certified developer: http://ez.no/certification/verify/346216

eZ debug

Timing: Jan 29 2025 13:34:49
Script start
Timing: Jan 29 2025 13:34:49
Module start 'content'
Timing: Jan 29 2025 13:34:49
Module end 'content'
Timing: Jan 29 2025 13:34:49
Script end

Main resources:

Total runtime0.0172 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.0625180.8125
Module start 'content' 0.00550.0058 768.875098.1172
Module end 'content' 0.01130.0059 866.992274.7031
Script end 0.0172  941.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002112.2173120.0002
Check MTime0.00105.6290120.0001
Mysql Total
Database connection0.00084.389010.0008
Mysqli_queries0.002413.867840.0006
Looping result0.00000.063620.0000
Template Total0.005431.210.0054
Template load0.00095.323510.0009
Template processing0.004525.847410.0045
Override
Cache load0.00063.664610.0006
General
dbfile0.002413.7697100.0002
String conversion0.00000.029030.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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