jquery - Incomplete XHR responses from IIS with compression -



jquery - Incomplete XHR responses from IIS with compression -

i'm loading scripts jquery ajax.

here's snip loader code, it's worth.

var resources = ['knockout-3.2.0.js', 'fonts/fontawesome-webfont.eot', ... ]; var retrycount = 0; load(0); function load(i) { if (i == resources.length) { $("#progbar").width("100%"); $("#progcaption").text("executing app/main...") var requirescript = document.createelement('script'); requirescript.setattribute("type", "text/javascript"); requirescript.setattribute("src", "scripts/require.js"); requirescript.setattribute("data-main", "app/main"); head[0].appendchild(requirescript); } else { $("#progbar").width(100 * / resources.length + "%"); var r = resources[i]; switch (r.substring(r.lastindexof('.'))) { case ".js": $("#progcaption").text(r); $.getscript('scripts/' + r) .done(function (data) { retrycount = 0; load(++i); }) .error(function (err) { if (err.status == 404 || retrycount == 3) { load(++i); } else { retrycount++; console.log('retry ' + r); load(i); } }); break; ...

recommended syntax getscript takes 1 parameter. either it's valid url or not. because start of resource returned know url valid . there no error in invoking code, jquery failing entire response before parsing script.

pointed @ same public facing server, $.getscript() throws error though err.status reports 200 ok. inspection of info shows truncated, , error js parse failure result of truncation.

this happens ie11 @ work, , problem stops manifesting when traffic routed through fiddler. doesn't occur @ on ie11 @ home. changing 'knockout-3.2.0.js', 'knockout-3.2.0.debug.js', causes knockout load without hitch, bootstrap.js isn't minified , play up, it's not simple no line breaks. thought might kind of server caching issue fixed name alter (it can't browser caching problem since getscript applies cache-buster parameter) tried renaming knockout-3.2.0.js knockout-3.2.0.min.js , made no difference.

questions similar symptoms:

ie returns incomplete html via ajax similar ie11 hardly "older" version, , adding fiddler equation fixes problem unlikely parsing hiccup.

ajax request homecoming 200 ok error event fired instead of success in case parsing failure caused inappropriate typing of response, not incomplete response.

i verified ie @ home , @ work both 11.0.9600.17690 update kb3032359.

the problem vanished when disabled iis compression.

i don't know whether static or dynamic compression because turned them off @ same time.

if microsoft wishes investigate (i wouldn't surprised if reply no, it's bit of border case)... have pcap files of failing exchange between client , server.

diagnostic summary it's not network, fails alternate route through phone it's not version of ie, same ie build @ home not fail it's not platform (both on win81) although network hardware drivers it's not iis, works @ home , on winphone81 , other browsers it iis, turning off server compression fixes it it's not iis, compression worked fine other browsers, although didn't think capture traffic browser worked compression on interposing fiddler resolved problem while compression active it's not browser caching problem, getscript supplies cache-buster parameter , when deliberately allowed caching obvious in capture files http no-change responses.

i have oddest feeling related why ie11 create blank post request except when fiddler running? couldn't why.

once files in cache size ceases signify, why run pre-loader - spa mine it's installation. powerful argument spa on traditional application architectures. lengthy setup mar first time experience.

the problem resolved disabling compression in iis.

jquery internet-explorer-11 fiddler getscript

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -