I have one site with FPC cache enabled that is always returning MISS in the X-Magento-Cache-Debug header.
How can I debug "who" is marking the homepage non-cacheable?
So far I checked the usual suspects:
- Caches status is enabled including FPC cache.
- Tested with and without Varnish
- Checked all the source code for the modules searching for "Cacheable = false" and isScopePrivate = true and for debugging purposes changed them to "Cacheable = true" and "isScopePrivate = false".
- I disabled third party modules, run a setup:upgrade
- Changed to developer mode, cleaned caches, recompiled
So, the thing is, is there any function where I can put a piece of log to determine who is "voting no" to have a cache?
Magento version is 2.3.5 p1
1 Answer 1
update
After extensively checking that cacheable=false was not written anywhere I found that a plugin (mageplaza bettermaintenance) was incorrectly setting "noCacheHeaders".
So, next time, after grepping for "cacheable=false" I'll grep for "setNoCacheHeaders" as well.
https://github.com/mageplaza/magento-2-better-maintenance/issues/24
cacheable=falseis not written there. Also is there any third party modules which are located under vendor? Did you checked by disabling them also?