Sitemap generation cron job flushes entire cache #14857
Labels
Component: Framework/Cache
Component: Sitemap
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
Preconditions
Magento 2.1.12
Magento 2.2.3 (suspected based on looking relevant code, but not confirmed)
Steps to reproduce and actual result
Look at debug.log output at midnight (configured sitemap cron schedule) in store timezone for this output:
main.DEBUG: cache_invalidate: {"method":"GET","url":"http:/","invalidateInfo":{"tags":[],"mode":"all"},"is_exception":false} []
This indicates the entire cache was flushed.
Expected result
Only FPC is flushed.
Discussion
The class
\Magento\Sitemap\Model\Sitemap
sets$_cacheTag = true
, whichAbstractModel::afterSave()
andcleanModelCache()
understand to mean it should flush the entire cache.This was introduced by the core team's fix for MAGETWO-47607 (#2802). (Note that this is not the commit that #2802 was officially closed for; it seems that two different fixes for the same issue were merged.) See commits 6edb0da (2.2.x) and 3cd22e2 (backport to 2.1.x).
The text was updated successfully, but these errors were encountered: