2

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

2
  • 1
    Are you using any custom theme? Have you checked in theme that cacheable=false is not written there. Also is there any third party modules which are located under vendor? Did you checked by disabling them also? Jun 14, 2021 at 8:00
  • On first request, the page will be cache hit miss and then from second hit , we see see X-dubug hit
    – Amit Bera
    Jun 14, 2021 at 10:02

1 Answer 1

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

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.