nishantagarwal
nishantagarwal

Reputation: 181

IIS 7.5 and ARR - 304 status code not sent for images

We have setup a reverse proxy using ARR in front of our Sitecore site. We are using this reverse proxy for serving sitecore media items only. Sitecore media items are getting cached properly on disk using ARR.

Now the problem we are facing is that, for all images, the HTTP Status Code is always 200 and so they are not cached in browser. If we disable reverse proxy then HTTP Status Code is 304 and browser renders images from local cache.

Is there any reason why ARR does not send 304 status code ?

Update #1: Below is the ARR rule which we have setup:

    <rule name="Default ReWrite" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
      <match url="^(.*)" />
      <conditions>
                    <add input="{CACHE_URL}" pattern="^(https?)://" />
      </conditions>
      <action type="Rewrite" url="http://127.0.0.1/{R:0}" logRewrittenUrl="true" />
                <serverVariables>
                </serverVariables>
    </rule>

Upvotes: 0

Views: 1966

Answers (1)

Yasin75
Yasin75

Reputation: 66

See the post: http://forums.iis.net/t/1213330.aspx?ARR+Disk+cache+return+200+instead+of+304+for+cached+files

Looks like its related to ETAG (IF-NONE-MATCH) headers - this wont work if the ETAG is issued from a server and later gets validated by another server (ARR in this case). So ARR never returns 304 to browser, but simply gets the cached file from disk and returns 200 to browser.

Upvotes: 3

Related Questions