I have created an ASP.NET IHttpHandler to serve images from a database. The handler works fine, but I am struggling to optimize it for clientside caching. I have followed the recommendations in the following article ...
While using Fiddler to monitor HTTP traffic, I can see that the headers have been correctly added to the response stream, exactly as described.
However, despite the caching headers, my browser is still requesting the images to be re-sent. This behavior is identical in IE7 and Firefox. I haven't changed the default caching configuration of either browser, so I can assume that I am seeing what the majority of my web visitors would see.
I have even added an additional "Expires" header to the response stream but, when refreshing a page containing the served images, the browser always sends a request with the "If-Modified-Since" header. Isn't it supposed to unconditionally use its own cached copy if the expiry period is still valid?
Any suggestions please?