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

后端 未结 5 864
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:04

    This may be a little late, but I want to point out a few alternative points that should be covered too.

    The first is that minification normally employs some sort of uglification for JavaScript, which has benefits outside bandwidth - it prevents people from easily analyzing the code, which prevents normal users from using verbose methods and ideas malicious actions - even well-built sites can have problems with this. Of course, this is no substitute for security, and advanced users could always decipher uglified code.

    The other is that not all browsers or connections are going to be using HTTP/2, at least not immediately - so if the performance of some HTTP/2 feature is barely noticeable on HTTP/2 clients, why not benefit those connecting still over HTTP/1.1?

    Lastly, at the end of the day, the best way to determine how anything impacts the speed of your server is to benchmark it.

提交回复
热议问题