I'm trying to set my images to cache. With no settings, I'm getting a 304 response from the server, which means that while 100 requests are being made for each of my images, the image isn't actually being transferred.
Great.
Now I want to tell the browser to use the image from cache without making the request to see if it was modified.
I go into IIS7 and click on the folder with my images, select the HTTP Response Headers and click Set Common Headers.
On the dialog the apears I check off the "Expire Web Content" box and I select the "After" option and I select 1 Day(I also tried 2 days).
I click OK and run a iisreset (although I don't think this is nessesary). I open up internet explorer with the network tab active and load the page. The browser loads the images. They are 200 responses and I check the headers and find "Cache-Control:max-age=172800" Great.
Now I reload the page (clicking on a link that loads the same page, or clicking in the address bar and pressing enter... NOT clicking refresh) and check the network tab again. I'm still getting 304 repsonses from the server, the browser is not directly loading the image from cache.
What do I need to do to get the browser to load this from cache?
Note: This works correctly in Chrome (Of course, story of my life)
Note2: Someone noted that sometime IE says 304 even though it is really going strait to cache. I don't see it going through Fiddler, HOWEVER, I see in the network tab of IE9 it is saying the Response time is 327 milliseconds. This time seems to increase for the images that are loaded later. So out of the 100 images the first 10 had respnses between 16-70 ms and the last 10 had responses of over 800 ms. The one that took 327ms was somewhere in the middle. Is IE really this inefficient retrieving from the cache?
Also, I should note there are files, such as some css files, that IE says are 304, however the response time is <1ms, which I'm assuming means it actually got it from cache without going over the network. That's different than this case for my images where IE actually shows a response time of hundreds of milliseconds.