Skip to content

Text plugin not caching response in IE11 #134

@rwhepburn

Description

@rwhepburn

In IE 11, it seems the RequireJS text plugin only caches the response when requesting .html files for the current browser session. Refreshing the browser causes the underlying XMLHTTPRequest object to issue a new request to the server and will download the file again. This has obvious performance implications.

Here's a typical request:

GET https://cdn.<servername>.com//app/app.html?v=5%2F6%2F2017%203%3A55%20AM
200 OK (text/html) Cache-Control: no-cache

Here's a typical response:

HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Origin: https://<server>.com
Cache-Control: public,max-age=1296000
Content-Type: text/html
Date: Sat, 06 May 2017 04:27:34 GMT
Etag: "56c34a5bd8a1d11:0"
Last-Modified: Fri, 29 Apr 2016 05:31:18 GMT
Server: ECAcc (cha/80AB)
Strict-Transport-Security: max-age=16070400; includeSubDomains
Vary: Accept-Encoding
X-Cache: HIT
X-Powered-By: ASP.NET
Content-Length: 95

<div>...</div>

For reasons unknown to me, the xhr requests sent from IE 11 contains a header Cache-Control: no-cache? The request is hitting a CDN, which gets passed on to the origin server and then is returned through the CDN.

Right now IE 11 always re-fetches html files, but chrome does not. In Chrome, caching works as expected and the html files are never re-fetched.

I initially thought this was related to Microsoft's XMLHTTPRequest implementation so I tried enabling the msCaching property (see https://msdn.microsoft.com/en-us/library/dn265016(v=vs.85).aspx) but setting msCaching = 'enabled' didn't seem to have any effect.

I've tried everything I can think of and I still can figure out how to get xhr to cache these html pages.

Any help would be greatly appreciated!

Thank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions