eZ Community » Forums » Setup & design » ViewCaching per user
expandshrink

ViewCaching per user

ViewCaching per user

Wednesday 20 April 2011 4:29:56 pm - 7 replies

Hello,

I'm having questions about viewCaching.

I work on an Intranet with almost 3000 users. ViewCaching is disabled. When I enabled it, caches are not regenerated and users do not see the most recent data.

First question : Should I really enable ViewCaching ?

Second question : If I enable ViewCaching with "pr_user" parameter, I guess my site could generate a very very large number of caches. Is it right ?

Thursday 21 April 2011 8:46:04 am

Yes, you should really enable ViewCaching. Usually you should disable it for some complex pages and use template cache-block on thoose pages instead.

As you can see in the docs:

view caching is not generated per user, but rather per set of permissions/preferences:

Please note that eZ Publish creates multiple view caches for the nodes based on roles and user preferences. This means that for example different users (who are logged in, with different permissions/preferences) will be served different caches while anonymous users and users with the same type of permissions/preferences will be served the same file. In other words, when view caching is on, the "view" view of the "content" module will only be run if the system is unable to locate a view-cached version of the result - otherwise a cached version will be inserted in the pagelayout. Please note that the pagelayout itself is not cached by default.

As for your problem, there can be several reason for it so you should investigate it a little bit further and give us some more info.

For example, the cache dir of your frontend siteaccess should be the same as the cache dir for the admin siteacces. Also, view cache for a node is regenerated only when the node is changed and published. Furthermore, the parts of the page that are in pagelayout.tpl do not use view cache. And so on...

Thursday 21 April 2011 2:17:59 pm

Sorry Marko but Franck is right: if you enable the ViewCacheTweak pr_user, ViewCaching will be generated per user. Franck, you can indeed try enabling it, and see how it performs. But it will indeed generate lots of cache files, as a combinatory of user + preferences if you have any. Cache clearing can then be quite heavy. But it is worth a try.

pr_user or not, as Marko said, it should get cleared when the related content is updated, as simple as that. Investigate based on what Marko told you, and you should figure it out. Ask again here if you need help.

Thursday 21 April 2011 3:47:05 pm

Sorry Marko but Franck is right: if you enable the ViewCacheTweak pr_user, ViewCaching will be generated per user. Franck, you can indeed try enabling it, and see how it performs. But it will indeed generate lots of cache files, as a combinatory of user + preferences if you have any. Cache clearing can then be quite heavy. But it is worth a try.

Yes, sorry I didn't notice that part. But this proves that ViewCacheTweak should be documented in the official docs (and not only in Serwatka's hidden gems).

Thursday 21 April 2011 4:24:53 pm

Ok, I will try this. Or maybe not if i don't have time...

And don't mind eZ Publish ! You are well documented. blunk.gif Emoticon

Thursday 21 April 2011 5:22:32 pm

Yes, sorry I didn't notice that part. But this proves that ViewCacheTweak should be documented in the official docs (and not only in Serwatka's hidden gems).

True, true... maybe you could file a documentation issue ? Our doc manager is quite responsive, we keep him well fed !

And don't mind eZ Publish ! You are well documented.

Thanks ! But you're being overly kind here blunk.gif Emoticon

Saturday 23 April 2011 11:21:51 am

Yes, sorry I didn't notice that part. But this proves that ViewCacheTweak should be documented in the official docs (and not only in Serwatka's hidden gems).

True, true... maybe you could file a documentation issue ? Our doc manager is quite responsive, we keep him well fed !

OK, here it is:

Tuesday 10 July 2012 3:37:24 pm

This forum post explains where to find the ViewCacheTweaks settings in site.ini/[ContentSettings]
http://share.ez.no/forums/developer/optimizing-view-cache-with-logged-in-user

In the site.ini file, ViewCacheTweaks is documented to some degree.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from