Does minifying and concatenating JS/CSS files, and using sprites for images still provide performance benefits when using HTTP/2?

后端 未结 5 858
Happy的楠姐
Happy的楠姐 2021-01-31 14:33

With the new HTTP/2 protocol the overhead created by repeated HTTP requests to the same server has been greatly reduced.

With this in mind, are there still any significa

5条回答
  •  既然无缘
    2021-01-31 15:25

    Yes, it is still useful.

    Along-side with gzip compression, you page will weight less.

    Imagine you are using a very slow GPRS (56Kbps, 500ms ping) network.

    You have 50 tiny images, 30 javascripts and 20 css files.

    This means that, with 2 parallel connections, you must wait over 100 * 500ms just for the requests.

    Now, each image is about 3-4kb. Which might take a few milliseconds (5-8?).

    Now, the CSS files and Javascript range from 20Kb to 600Kb.

    This will kill your website with a huge transfer time.

    Reducing the time to transfers the files will increase the 'speed' at which the website will load.

    So, YES, it is still useful!

提交回复
热议问题