Website Optimization: Why Faster Consolidated Files?

I read that combining all of your css files into one large or all of your script files into one script file reduces the number of HTTP requests and therefore speeds up the download speed.

But I don’t get it. I thought that if you had several files (to the limit, which I consider in modern browsers 10), the browser would load them in parallel, thus REDUCING the total download time (divided by the number of allowed connections).

I clearly lack key information here. Can someone turn on the lights?

+3
source share
2 answers

Overhead in each request / response. This, in essence, is what it boils down to.

Google...

GET http://www.google.com/ HTTP/1.1 : /x-ms-, image/jpeg, application/xaml + xml, image/gif, image/pjpeg, /X -MS-XBAP, /vnd.ms-Excel, /vnd.ms-POWERPOINT, /MSWord, /x -shockwave-flash,/ Accept-Language: en-US User-Agent: Mozilla/4.0 (; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; GTB0.0; SLCC2;.NET CLR 2.0.50727;.NET CLR 3.5.30729;.NET CLR 3.0.30729; Media Center PC 6.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3) Accept-Encoding: gzip, deflate : Keep-Alive : www.google.com Cookie: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

... http://swortham.blogspot.com/2010/03/latency-requests-css-sprites-and-you.html

, (2 , ). , , , , . , 20+ css, js . , .

+6

:

  • TCP - keep-alive , -, " HTTP- - TCP-" .
  • HTTP- - - , .
  • ( ) - keepalive
  • - . IE6 2 , 6 IE8 ( ). . ( " 4 1" ).
+3

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


All Articles