View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006931 | OXID eShop (all versions) | 4.08. Cache | public | 2018-12-12 10:48 | 2024-07-03 15:35 |
Reporter | michael_keiluweit | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 6.1.1 | ||||
Summary | 0006931: EE: Article::onChange calls ContentCache::reset twice. | ||||
Description | The method \OxidEsales\EshopEnterprise\Application\Model\Article::onChange calls \OxidEsales\EshopEnterprise\Application\Model\Article::_resetCache which has a logic to control the cache wether it should be flushed completely or only particular. After the call of _resetCache is an additional flushing of the cache, which is too much as it makes the work before completely unnecessary. We have to possible cases in _resetCache: 1. The cache was flushed completely, then the second flush is overhead. 2. The cache was flushed particularly, then the second flush flushes too much. Furthermore the method _resetCache checks if the call was made in the frontend and if the cache is active. The other call of the flushing doesn't check the context. That means: 1. Either the second call is overhead and has to be removed 2. Or there is a missing check if the call was made in the context of the backend like: If the call came from the frontend check if the cache only have to flush particular or check if the call comes from the backend and if so, flush the cache in every case completely. | ||||
Additional Information | The Method \OxidEsales\EshopEnterprise\Application\Model\Article::onChange// cache control .. $this->_resetCache($articleId); [...] if ($config->getConfigParam('blUseContentCaching')) { $genericCache = oxNew(\OxidEsales\Eshop\Core\Cache\DynamicContent\ContentCache::class); $genericCache->reset(); } If you would add the cache logic from _resetCache to onChange: // cache control .. // < instead of calling the method _resetCache> if (!$this->isAdmin() && $config->getConfigParam('blUseContentCaching')) { $contentCache = oxNew(\OxidEsales\Eshop\Core\Cache\DynamicContent\ContentCache::class); if ($database->getOne($query)) { $contentCache->reset(); return; } [...] $contentCache->resetOn($resetOn); // </ instead of calling the method _resetCache> [...] if ($config->getConfigParam('blUseContentCaching')) { $genericCache = oxNew(\OxidEsales\Eshop\Core\Cache\DynamicContent\ContentCache::class); $genericCache->reset(); } As you see, the logic from _resetCache is completely unnecessary as at the end of onChange the cache is flushed every time completely. Because of that, I think, there is a missing check if the method was called in the context of the administration area. | ||||
Tags | Cache, EE | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||