asp.net - External CSS shows up in head tag, rather than separate file -


platform
* asp.net webforms - c#
* .net 4.5
* azure web hosting
* chrome (43.0.2357.134 m) - latest


problem
bundling css , javascript using asp.net web optimization framework. when testing in local environment, working great. can see aspx page relatively small , bundles listed separate individual files (cssall & jsall).

https://www.dropbox.com/s/dazt681qylk41hm/local-login-cache.png?dl=0

once deploy azure, javascript bundle remain correctly linked , cached, css bundle no longer referenced. instead, css code written directly head tag of aspx file. causes aspx file grow exponentially (from 5kb 87kb) , prevents css being cached. interestingly, when disable cache, css file sent seperate file, , aspx returns smaller size.

https://www.dropbox.com/s/eox7b0vc0mi27wo/azure-login-combined.png?dl=0


my thoughts & questions

  1. is normal behavior? misunderstanding or misusing chromes developer tools and/or way css caching works?
  2. if normal behavior, why local environment respond differently azure hosted environment?
  3. if not normal behavior, issue be? (please read considerations below see have tried or troubleshooted)

considerations

  • i have confirmed css, javascript, , relevant directory structures identical between local machine , azure. (web deploy handled well)

  • i have tried exact same tests ie11 , firefox, getting similar results. if caching disabled, css comes seperately intended, if caching enabled, css verbosely written head tag of aspx page.

  • problem not bundling because working. however, have tried linking each css file directly, rather using bundle, , same oddity occurs.

  • i have cleared browser cache (using clear browsing history in chrome) between tests , have used multiple computers test this, yet results same.

  • the page illustrating small, other larger pages fair worse , can grow upwards of 600kb, due oddity.

the odd bundling behavior resolved!

my local project set use "https" default. however, when browsing production site on azure, noticed using standard "http". once enforced pages routed through "https" in azure, css bundled, linked , cached.

- disclaimer, have no idea why works, fix particular problem. if can explain "why", please feel free so.


Comments