Even when things are working as expected, it’s nice to be able to verify what’s going on, and really prove it. These response headers are excellent:
Is it a MISS or HIT, and which cache.
Our web server is sending Response Headers that includes
Vary: Cookie, origin. That means the caching decision will be affected by Cookies, which makes sense.
On a certain set of pages, I’m stripping out the Cookies to cause more caching to take place.
Regardless of csrftoken, all users get the same cached content.
I would like to verify this. What comes to mind is another response header something approximately as follows:
In other words
When analyzing this particular result we would see that the cache decision was based on the URL, and maybe something unexpected, another cookie called “sessionid”. Since each user has a unique sessionid, we know that caching is very inefficient, and most likely each user will get
x-cache: MISS because they have a unique sessionid.
To mitigate the problem, remove that cookie too:
Now, without any sessionid cookie, it says:
The question is, if there is a simple VCL recipe which could add this response header, and return an
x-cache-key value which has the above mentioned behavior. List each factor which affected the caching decision. More specific than just saying “Cookies”. Which cookies, for that particular cached webpage.