isotropic-2022
Share
Blog
Search
Menu

Merge and Minify (CSS/JS) Should Be Avoided on HTTP/2 Servers

By James LePage
 on January 5, 2021
Last modified on January 7th, 2022

Merge and Minify (CSS/JS) Should Be Avoided on HTTP/2 Servers

By James LePage
 on January 5, 2021
Last modified on January 7th, 2022

Merging and minifying files is a great practice if you are optimizing your WordPress website for speed, but it should be avoided on an HTTP 2 server. In this article, we're going to discuss what HTTP 2 is, why it is really good for WordPress performance, and why you don't want to merge and minify files if you're using this new technology.

Both of our favorite performance optimization plugins, WPRocket and Asset CleanUP Pro both allow you to easily merge and minify CSS and JavaScript. This takes all of the individual files that are found on a page, and puts them into a single file. That limits the HTTP request, speeding up your website.

At least, it works very well for an HTTP1.1 based website. Now, with HTTT2, this practice will actually slow down your performance. Here's why.

When loading a website from an HTTP1.1 server, A single request is processed at a single time period. therefore, the browser will first download the CSS, then another CSS, then another JS, then an image, and then the page will be rendered. This happens one after another, until all assets are loaded on the page. If you check a waterfall chart for this type of website loading, you will see that one request ends, and another one begins.

That's why the conventional wisdom is that merging all of these requests into a single larger request is true, and will speed up the loading time of your website. And this is absolutely true. A single HTTP request on an HTTP 1.1 based server will always load quicker then multiple, as there is no waiting period.

Via Upwork

With HTTP 2, All requests are loaded simultaneously. There is no waiting process, and there are the same number of connections for the number of assets being requested. Therefore, merging and minifying will simply create a larger file, taking a longer time to upload and download, leading to a longer render process for the website. By keeping all of your individual files unmerged and minified on WordPress, they can all load at the same time, and each upload and download is for a smaller file, resulting in a quicker loading time.

It's still a good idea to use Asset CleanUP Pro or WPRocket, and this only applies to a server that uses http2. You can check if yours does here:

HTTP2 is much quicker, So if you are considering moving hosts or upgrading your website performance speed, definitely look and see if they support this method of data transfer. Our recommended host, Rocket.net, which is where this website is hosted, supports HTTP 2, so it's a good place to start your search.

Subscribe & Share
If you liked this content, subscribe for our monthly roundup of WordPress news, website inspiration, exclusive deals and interesting articles.
Unsubscribe at any time. We do not spam and will never sell or share your email.
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Steve Deakin
Steve Deakin
3 years ago

Hi, your mailing list form is not working

Thomas Krakow
Thomas Krakow
2 years ago

Hi, Minifying is nevertheless useful. The merge is just no longer necessary.

Article By
James LePage
Contributors/Editors
notloggedin
James LePage is the founder of Isotropic, a WordPress education company and digital agency. He is also the founder of CodeWP.ai, a venture backed startup bringing AI to WordPress creators.
We're looking for new authors. Explore Isotropic Jobs.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram