1

After reading some comments on the ticket magento2/issues/25670 what I can understand is Magento 2 creates/stores a tag for each entity which is modified. For example if a product is modified it's tag is stored and cache of that entity is cleared automatically. But I am not sure if my understanding is correct.

My questions are:

  • How this tag is stored? Does it store the product id/sku of the product which was modified or it stores the entity name only (ex: catalog_product)?
  • Where this tag info is stored? In db/file?
  • What kind of caches are cleared on product edit? Does it clear cache of a particular entity or it clears full page cache? Any other caches are cleared on product edit?
  • These caches are cleared on product save only or on admin product page load also?

1 Answer 1

0

This is a feature!

Magento 2 out of the box will clear correct caches on the frontend depending on cache tags. Each entity that impacts the cache will have it's own tags. Once a product is saved all of the pages on which that product appears will be cleared. No need to flush the cache.

See more info here: http://devdocs.magento.com/guides/v2.1/config-guide/cache/cache-priv-inval.html

The Magento application enables you to clear cached content immediately after a entity changes. We use an IdentityInterface to link entities in the application with cached content and to know what cache to clear when an entity changes.

1
  • Can you please answer the 4 questions that I have asked like how/where the tag information is stored? You have mentioned once a product is saved all of the pages on which that product appears will be cleared. How cache is cleared for a particular page? For example, let's say product is assign to category "Test", and if the product is modified, will it clear cache for this category only or all?
    – amitshree
    Commented Sep 5, 2021 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.