In my scenario, I have an aspx page which has links to some .js files.
What I have observed is that, some times my browser returns a 200 response even though I have added the following settings in my web.config
<customHeaders>
<clear />
<add name="Expires" value="Sun, 07 Apr 2047 00:00:00 GMT" />
<add name="Cache-Control" value="max-age=5"/>
</customHeaders>
As far as my understanding goes, unless there is a change in Etags the file should be retrieved from the cache and thus return a 200 response.
In my 200 response headers
Last-Modified = Thu, 23 Feb 2012 10:02:49 GMT
Etag = "82f46e4c12f2cc1:0"
In my request Headers
If-Modified-Since = Thu, 23 Feb 2012 10:02:49 GMT
If-None-Match = "80aa474c12f2cc1:0"
I know that
If-None-Match != Etag
Then we should get a 200 response. Ideally if the Etags are generated from the Lastmodified date only, then it should not change no matter what. But as you can also see, it gets changed automatically. This means that Etags have a tendency to change.
Question: How do we control this modification? Especially through the web.config.