View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003344 | OXID ERP Interface | OXID ERP Interface - sub | public | 2011-10-31 16:03 | 2014-03-18 12:11 |
Reporter | faltmeyer | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 2.10.0_45565 | ||||
Fixed in Version | 2.11.0_52702 | ||||
Summary | 0003344: Caching Numbers of contained products in category | ||||
Description | in LocalCatCahe.txt the numbers of contained products of each category will be cached. If assigment of product to category will be done in admin area, the cache file will be updated. But if I change assigment of product to category via ERP Soap Service, the cahe file will be untouched. So umbers of products of each category in frontend will show the wrong value. | ||||
Tags | No tags attached. | ||||
related to | 0005697 | acknowledged | ERP call timeouts while reassigning articles to categories |
|
which as well leads to another problem: the pagination does not work correct and offers only a few pages, not all - based on the wrong, old value of contained products |
|
Two suggestions for counting category articles: 1. in oxutilscount::setCatArticleCount there is sql-code which is the same as in oxarticlelist::_getCategoryCountSelect. If _getCategoryCountSelect would be public, oxutilscount could use it like $oArtList = oxnew("oxarticlelist"); $sQ = $oArtList->getCategoryCountSelect( $sCatId, null ); $aCache[$sCatId][$sActIdent] = $oDb->getOne( $sQ ); This would give the possibility to modify article loading in a category by modifying _getCategoryCountSelect and _getCategorySelect. 2. in oxarticlelist::loadCategoryArticles cached number is used in case no filter is active (this does not test if filter is set for current category). Suggestion is: always really count articles here with _getCategoryCountSelect, and if no filter is active for current category, compare with cached article count and update cache on mismatch. This is just one sql and very little overhead, and would assure that article count for active category is up-to-date. |
|
Hi [QUOTE] always really count articles here [...] compare with cached article count [/QUOTE] This way makes the cache useless... but and you can reduce the appeared overhead (compare, refresh cache) by removing the caching totally from this function. This is not a solution. The only solution is to keep the cache untouched until the number of products is changed. Any process that change the number of products should delete the related cachefile(s). |
|
"This way makes the cache useless... " No, this just disables cache for currently active category. Caching is still active for all other categories in oxcategory::getNrOfArticles. You will not notice any difference in speed of page loading by disabling cache of category count only for active category, just try it. Caching is not needed here, and the number of articles in current category is important because it controls the number of pages displayed. There are lots of processes that change the number of articles, chance is high that you miss one and get the wrong number. For example, if you change stock to zero in admin and a product goes offline, cache is not updated. |
|
now article cache is updated in erp |