Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text plugin not caching response in IE11 #134

Open
rwhepburn opened this issue May 6, 2017 · 1 comment
Open

Text plugin not caching response in IE11 #134

rwhepburn opened this issue May 6, 2017 · 1 comment

Comments

@rwhepburn
Copy link

rwhepburn commented May 6, 2017

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

@venkateshnadar8
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants