Monday 30 March 2009
This article describes in detail the principles and functions of the new cache system present in eZ Publish 4.1. Overall the idea can be summarised as follows: instead of deleting cache elements and then regenerate them across concurrent requests, the logic is reversed to a refresh algorithm. Basically a cache element will be marked as invalid but not deleted until a new version is ready. During the generation of the new cache element, the old version will still be served until it is ready.
This enhancement stems from valuable feedback we got from the market. Many times, adopters of eZ Publish knocked on our door to tell us they had performance issues when lots of content editors were (hyper)active on their eZ Publish-based application.
For those who are not familiar with the details, let's brush up on the background information required to understand the problematic they stumbled upon. As an example, when displaying a content object, say in 'full' view mode, eZ Publish stores the HTML resulting from template processing ( or “caches it” ). That is called the “View Cache”, which will be re-used next time the piece of content is displayed the same way. This prevents from processing the display templates every time the content object is displayed, significantly alleviating load on the application. This system has been in place for a long time now ( slightly before 3.0 ).
In order for the displayed content to be in full sync with the actual content as real-time as possible, the View Cache for a content object is expired when a new version of the object is published. That means that the “cached” HTML needs to be refreshed, causing the display template to be processed anew the first time the content object is displayed in its new version. More information can be found here: http://ez.no/doc/ez_publish/technical_manual/4_0/features/view_caching.
The “View Cache” is taken as an example here, but improvements brought by the Stale Cache feature also apply to Cache Blocks and other types of cache. And please also note that this feature applies to non-cluster modes as well as cluster modes.
When several concurrent users are requesting the same object, for which the View Cache just expired, requests are queued, only the first of them triggering the View Cache regeneration. This implies that nearly all requests received at this specific moment ( except the very first one ) will be waiting for the fresh cache to be available, raising two major drawbacks :
Hi John,
Unfortunately not, this feature is present from eZ Publish 4.1 on. If migration is an option, you should make your way there.
Cheers !
Is it possible to add this feature on version 4.0?
Everybody may got some problems in daily life, like loan problems, how to lose weight fast?which is the best travel agency? and baby care problems? Google can help you to find out the answers.
This is fixed now!
We are working on it currently. This happened when migrating the articles, as you may expect.
Thanks for the feedback!
Best Regards,
You must be logged in to post comments.