asp.net - Browser refresh corrupts bundled javascript -


i added asp.net javascript bundling , minfication our website, , have discovered if refresh website, bundled javascript file downloaded gzip never uncompressed browser, site of course doesn't work since javascript still compressed. if refresh again, site fine. refresh again, corrupt. , forth. happening in chrome , safari, not in ie.

watching in fiddler, ie gets javascript first time, , subsequent refreshes return 304 not modified correct. chrome / safari refreshes continually return 200 each refresh.

if run website locally hosting in iis express, problem not occur. it's in our other qa, staging , production environments website hosted iis 7.5.

i did fiddler compare of chrome request , bad chrome request see what's different. identical except bad request has "if-modified-since" header.

the response server when "if-modified-since" header there has content-type of "application/javascript", , think causing problem, browser doesn't know should uncompress response body.

here request , response (body omitted brevity):

get https://wwwq.website.com/scripts/main.js?v=z3qotk2bjf3mvsqylf2ky82laidw4jr0epo01whf93u1 http/1.1 host: www.website.com connection: keep-alive accept: */* user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/48.0.2564.97 safari/537.36 dnt: 1 referer: https://www.website.com/ accept-encoding: gzip, deflate, sdch accept-language: en-us,en;q=0.8 cookie: < cookies omitted >  http/1.1 200 ok date: fri, 05 feb 2016 13:46:30 gmt server: microsoft-iis/7.5 cache-control: public content-type: text/javascript; charset=utf-8 expires: sat, 04 feb 2017 13:46:31 gmt last-modified: fri, 05 feb 2016 13:46:31 gmt vary: user-agent,accept-encoding x-aspnet-version: 4.0.30319 x-powered-by: asp.net via: 1.1 wwwq.website.com (access gateway-ag-2772908347919084-467794) keep-alive: timeout=300, max=99 connection: keep-alive content-length: 62702 

here bad request , response (body omitted brevity):

get https://www.website.com/scripts/main.js?v=z3qotk2bjf3mvsqylf2ky82laidw4jr0epo01whf93u1 http/1.1 host: www.website.com connection: keep-alive cache-control: max-age=0 accept: */* user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/48.0.2564.97 safari/537.36 dnt: 1 referer: https://www.website.com/ accept-encoding: gzip, deflate, sdch accept-language: en-us,en;q=0.8 cookie: < cookies omitted > if-modified-since: fri, 05 feb 2016 13:46:31 gmt   http/1.1 200 ok date: fri, 05 feb 2016 13:46:43 gmt server: microsoft-iis/7.5 cache-control: private x-aspnet-version: 4.0.30319 x-powered-by: asp.net vary: accept-encoding via: 1.1 www.website.com (access gateway-ag-2772908347919084-467849) content-length: 16042 keep-alive: timeout=300, max=94 connection: keep-alive content-type: application/javascript 

if can me out incredibly grateful running out of ideas.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -