At work our sites site behind a NetScaler which caches the response. I am trying to understand how this works.
So the website has authentication, if you do not have the fed-auth cookie you get a 302
response to redirect to the Oauth source. And a 200
response if the user is authenticated.
The NetScaler is setup to cache 200s responses but not 302s
My question is when I make a request since the server is determining 200 or 302 how does NetScaler know to return a cache response without going to the server?
A simple understanding of caching would lead me to the conclusion that all request would return the 200 response without checking with the server.
But that is not what we are seeing. In manual testing the site is working as expected logging people in and out as expected. However, when automated testing is applied, the user is getting the 200 cached response. I say it is the cached response because we see an ETag
and a Via: NS-Cache
in the headers.
If someone can point me to a resource or a short explanation so I can be better informed that would be appreciated.