Why do all browsers download all CSS files - even for media types they don't support?

后端 未结 7 2101
闹比i
闹比i 2020-12-04 09:28

If I specify a CSS link with an unsupported media type (\"bork\") it still gets downloaded by every browser I\'ve tried (including both desktop and several mobi

相关标签:
7条回答
  • 2020-12-04 10:07

    Sometimes, it's necessary to consider the prosaic answer. It's possible that all stylesheets are downloaded by browsers simply because the authors of each browser only really consider the case where there is a single (master) stylesheet when optimizing for speed, and the practice of a lot of sites of having a single stylesheet encourages this behavior. If nobody is testing for it, it's almost certainly not a case that's being optimized, as people prefer to work on results that are visible (or at least measurable). Maybe your question will encourage someone to change the testing regime…

    Also, I'd venture that the overwhelming majority of sites' stylesheets are static documents, and so capable of being very highly cached (and delivered by CDN too, if the site owners choose to pay).

    0 讨论(0)
提交回复
热议问题