Cloudfllare Cache


I want to know the cache mechanism of cloudflare
We are having weird issue with cloudflare cache. I am listing down test scenario below:

  • User A call an API endpoint with X-Id token through postman from his computer

  • User B hits same API endpoint with his own session ID as X-Id token through postman same location and different computer

First call succeed and each user gets their own data. and we don’t see any CF Cache hit header in response headers.

Now when user B send call again with same parameters it start getting responses of User A. and we see CF Cache header set to HIT in response

How come it cached 2 requests with different headers? We have set Cache policy to standard and Browser Cache Expiration to Request Headers.

Can someone explain how CF cache works internally? and what should be the possible fix for this?


Sounds like you have a cache everything page rule in place for that API endpoint.

closed #3

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