If an external file (e.g. JavaScript or CSS) is included twice (or more) per page, will there be two (or more) web requests?

Say, due to a conditional comment or just careless, the same included file is present for users of any browser or even all browsers. For example:

<!--[if lte IE 8]>
     <script src="mygreatincludefile.js" type="text/javascript"></script>
<![endif]-->

<!--[if lte IE 6]>
     <script src="mygreatincludefile.js" type="text/javascript"></script>
<![endif]-->

When the page is rendered, the browser does not want to capture this file again or makes a request, and the browser returns 304 (not changed). The best case, apparently the first, acceptable case, seems to be the second option, in the worst case, a new request, because the browser does not know that it just captured it.

Do you have any experience with this? What would you expect? What did you observe? Should I just not worry about it and hit the person who did it, bearing in mind that it might have been me?

+3
3

( IE), JavaScript . - <img>. , .

. . " IE8", " IE6", , .

+6

Fiddler, . IE ie6/7 (ie8 ) FireBug FireFox.

.

, , - HTTP, , -, , , . .

+3

CSS , Chrome CSS. , .

enter image description here

0
source

Source: https://habr.com/ru/post/1714147/


All Articles