Details
-
Bug
-
Resolution: Fixed
-
High
-
5.2
-
None
-
eZ Publish 5.2 EE
Description
The template block cache is always expired on content operations "sort" and "updatepriority", and this can cause the server load, because the cache is cleared multiple times in the same process.
updatepriority
File: ezpublish_legacy/extension/ezjscore/classes/ezjscserverfunctionsnode.php
Method ezjscServerFunctionsNode::updatePriority() calls eZContentCacheManager::clearContentCache().
In the end eZContentObject::expireTemplateBlockCache() is called that expires the "template-block-cache" in the expiry.php.
sort
File: ezpublish_legacy/kernel/content/ezcontentoperationcollection.php
Method eZContentOperationCollection::changeSortOrder() calls eZContentCacheManager::clearContentCache().
In the end eZContentObject::expireTemplateBlockCache() is called that expires the "template-block-cache" in the expiry.php.
possible solution
Instead of eZContentCacheManager::clearContentCache() it would be better if eZContentCacheManager::clearContentCacheIfNeeded() is called in above methods.
Also, the used methods are clearing cache although cache is disabled in the ini file.
clearContentCacheIfNeeded has this check:
if ( eZINI::instance()->variable( 'ContentSettings', 'ViewCaching' ) !== 'enabled' )
And the ezpublish_legacy/extension/ezflow/classes/ezflowoperations.php file has the following line:
eZContentCacheManager::clearContentCache( $contentObject->attribute('id') );