Friday, June 27, 2014

IIS ARR Reverse Proxy and HTTP Status Code 304

In IIS 7.5, reverse proxy using ARR v2, does not send 304 status code for subsequent requests which are cached on file system. Because of this, even if the actual website allows caching of requests in browser (client side), ARR always sends HTTP 200 code. This forces the browser to download the cached request again from server.

For some strange reason, ARR always send status code 200 if requests contains ETags.
So, basically if you want ARR to send 304 status code then ETags must be removed.

In IIS, Etags can be removed from response with the help IIS URL Rewrite module. Following outbound rule must be created to remove ETags:

  <rule name="Remove ETag">
    <match pattern=".+" servervariable="RESPONSE_ETag">
    <action type="Rewrite" value="">

For more details check below links:

No comments:

Post a Comment