This article provides a solution on how to avoid cache invalidation, which might cause the slow performance of an Adobe Commerce store.
AFFECTED PRODUCTS AND VERSIONS:
Slow site response.
Long response time might be caused by the cache being invalidated (flushed).
The cache is used to generate fast responses to the site visitors’ requests. If there is no appropriate cache data available, the Adobe Commerce application fetches the data from the database, calculates and aggregates the data, and stores it to the cache storage. The cache generation process requires additional system resources causing total response-time degradation.
There are two types of cache in Adobe Commerce:
You can find information regarding the invalidated cache types in the <install_directory>/var/log/debug.log
file.
To do this:
Open <install_directory>/var/log/debug.log
Search for " cache_invalidate " message.
Then check the tag specified. It indicates what cache was flushed. You might have issues because of the invalidated cache if you see a tag with no particular entity id specified, for example:
cat_p
- stands for catalog product cache.cat_c
- catalog category cache.FPC
- full page cache.CONFIG
- configuration cache.Having even one of them flushed would slow down the response of the website. If the tag contains an entity id, for example, category_product_1258
, this would indicate the cache for a particular product or category, and so on. Flushing cache for a particular product or category would not cause response time to drop significantly.
Following is a sample of a debug.log
containing records about the cat_p
and category_product_15044
cache having been flushed:
Usually, the cache becomes invalidated because of the following: