3

I'm currently trying to validate if FPC is working properly, however I'm getting results I don't fully understand.

If I'm in developer mode and have a clear cache I can see the following headers:

X-Magento-Cache-Debug:MISS
X-Magento-Cache-Control:max-age=86400, public, s-maxage=86400

On a pagereload I get a:

X-Magento-Cache-Debug:HIT

So this leads to the assumption that everything is working out fine. However the actual Cache-Control Header is always set to be:

Cache-Control:max-age=0, must-revalidate, no-cache, no-store

I thought that might just be because of developer mode, so I changed to deployment mode and expected the Cache-Control header to be:

Cache-Control:max-age=86400, public, s-maxage=86400

But as mentioned before I just got:

Cache-Control:max-age=0, must-revalidate, no-cache, no-store

Shouldn't the X-Magento-Cache-Control relate to the actual Cache-Control value? I currently not sure how the Magento FPC should Work but I'm assuming that this isn't the correct behavior and would not work if I will switch the FPC to use varnish. Any input on what is causing this issue will be appreciated.

  • Did you get any explanation? – Denis Spalenza May 17 '18 at 20:12
  • as far as i can remember, no :( – giggo1604 May 24 '18 at 12:03
1

From my understanding the cache-control response header is only important for assets, that should be cached in the browser cache - meaning it's an instruction for the browser, to cache this file locally.

Since the document itself is not cached client side (but server side), the cache control header should be ok this way.

As confirmed by this blog post, you should be doing fine, since the debug headers from magento should show the actual values for the server side cachíng mechanism (https://xumulus.com/make-sure-magento-2-full-page-cache-will-working-order-site/)

  • Place store in Developer Mode
  • Inspect the page headers in your browsers debug network tab.
  • Look forX-Magento-Cache-Debug: MISS
  • Refresh the page, it should change to HIT
0

I cannot add comment, but did you check that you have caching enabled?

From admin: System -> Tools -> Cache management

From cli: bin/magento cache:status

Hope it helps

  • yes they are all enabled but thanks anyway :) – giggo1604 Sep 1 '17 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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