4

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

asked Jun 14, 2021 at 7:39
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? Commented 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 Commented Jun 14, 2021 at 10:02

1 Answer 1

4

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

answered Jun 15, 2021 at 10:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.