Search code examples
cachingwindows-7internet-explorer-11

IE11 on Windows 7 does not cache files


When examining cache behaviour on our web site I got a very confusing result - my Internet Explorer 11 browser did not cache any files at all. The cache settings in the Internet Option is set to "Check for newer versions of stored pages: Automatically".

Investigating further with IE developer tool, all files were requested without an "if-modified-since" HTTP header, which of course caused the server to return the complete file with a 200 status result. Expected behaviour would be that IE should send an "if-modified-since" header, and the server then responding with a 304 (Not modified) status telling the browser to use the cached copy.

The same behavior occurs for all web sites I have tried.

I then used browserstack.com to open up a remote IE11 on a Windows 7-machine. Same result, no files are cached. However, on a Windows 8.1 machine, IE11 caches the files and sends a "if-modified-since" header, causing in 304 responses.

I include example request and response headers:

Request from Windows 7 / IE11:

Request:GET /EdUwb.png HTTP/1.1
Accept:image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5
Referer:http://stackoverflow.com/
Accept-Language:sv-SE
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding:gzip, deflate
Host:i.stack.imgur.com
Connection:Keep-Alive

Response from Windows 7 / IE11:

Response:HTTP/1.1 200 OK
Date:Wed, 05 Aug 2015 14:30:43 GMT
Content-Type:image/png
Content-Length:3635
Connection:keep-alive
Set-Cookie:__cfduid=dfbb24e8f5badb07e8f2bbd969590320b1438785043; expires=Thu, 04-Aug-16 14:30:43 GMT; path=/; domain=.imgur.com; HttpOnly
Cache-Control:public, max-age=315360000
ETag:"c5d00c1be2583713eca1d0ad1efdb914"
Expires:Sat, 02 Aug 2025 14:30:43 GMT
Last-Modified:Thu, 02 Apr 2015 19:36:41 GMT
x-amz-version-id:Rmrsr2WfDsdFppBa_Ju10BC3Y52.bglA
CF-Cache-Status:HIT
Vary:Accept-Encoding
Server:cloudflare-nginx
CF-RAY:2113339ae74b0a48-ARN

Request from Windows 8.1 / IE11:

Request:GET /EdUwb.png HTTP/1.1
Accept:image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5
Referer:http://stackoverflow.com/
Accept-Language:en-US
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding:gzip, deflate
Host:i.stack.imgur.com
If-Modified-Since:Thu, 02 Apr 2015 19:36:41 GMT
If-None-Match:"c5d00c1be2583713eca1d0ad1efdb914"
Connection:Keep-Alive

Response from Windows 8.1 / IE11:

Response:HTTP/1.1 304 Not Modified
Content-Type:image/png
Content-Length:3635
ETag:"c5d00c1be2583713eca1d0ad1efdb914"
x-amz-version-id:Rmrsr2WfDsdFppBa_Ju10BC3Y52.bglA
CF-Cache-Status:HIT
Vary:Accept-Encoding
CF-RAY:21133083e7920c5f-AMS
Expires:Sat, 02 Aug 2025 14:28:19 GMT
Last-Modified:Thu, 02 Apr 2015 19:36:41 GMT

Has anyone got an idea why the file is not cached on Windows 7?


Solution

  • IE11 devtools has a "Always refresh from server" option that is on by default. You have to turn this off to be able to watch caching happen in the devtools.

    IE Dev Tools