How to check page exist cache cloudflare with PHP?

I am having a problem. I use function get_headers().

F5 page => 1st time: CF-Cache-Status: Miss
F5 page => 2nd time: CF-Cache-Status: Hit
F5 page => 3rd time: CF-Cache-Status: Hit

But actually the page has not been cached. And it is always true for every page that has no cache.

The page has been cached, but in your case you are going via different datacentres and hence different caches.

I use chrome:

  1. Ctrl+Shift+N. And access this page => page no cache
  2. With current tab => F5 => this page cached. and no display wp-admin dashboard

Capture3

Not sure what you are trying to say by that.

after use fuction get_headers() one time. get_headers() always display CF-Cache-Status: Hit. Although no cache.

What is unclear about my earlier response?

I use it to check Purge cache


I do not understand the question. I use google translate. Can you say clearer?

I answered your question earlier. What is it, you do not understand about that response?

No, i don’t understand

That is apparent. My question is what it is that was not clear about the answer.

Here we go again

1 Like

Essentially, your server connects a Japanese datacentre, whereas your local browser goes via Singapore. In this case you will never have the guarantee that these caches are in sync.

I’d recommend to check out support.cloudflare.com as that explains how Cloudflare exactly works.

2 Likes

This topic was automatically closed after 14 days. New replies are no longer allowed.