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?