Why Concatenate Files in WordPress?


One of the easiest things that you can do to increase the speed of your website is to concatenate the CSS and JavaScript files that are loaded on your site.

This only takes a couple of minutes since all you need to do is install a plugin. For this, I have typically used WP Minify, but have also occasionally used Better WP Minify.

What is Concatenation?

Sure, I can tell you that concatenation will help speed up your site, and you can easily install a minification plugin… but why does concatenation help?

First, to understand why concatenation helps, we need to understand what concatenation is.

Simply, concatenation is the combining of files into one large file.

For example: Instead of loading many CSS and JavaScript files for the many plugins that your site has enabled, these files would be combined into one large CSS and one large JavaScript file.

How Does Concatenation Help?

To understand why concatenating files is beneficial, let’s consider the act of having to bring in many grocery bags.

Imagine that there are 12 bags in the trunk of your car. You have the option of taking all 12 bags in one trip or taking a trip for each bag.

If you take all 12 bags in one trip, the trip will likely take a bit longer since you’re carrying more weight. But, if you take multiple trips, then you’re traveling the same distance many many times.

Arguably, taking all 12 bags in one trip will require more effort but will be faster.

This is very similar to why concatenation helps speed up your site. Instead of the browser having to take multiple trips to the server to download several JavaScript and CSS files, these files are packaged into just two larger files.

While these larger files themselves will take a bit longer to download, the browser isn’t having to take multiple trips back to the server to download individual files.

Leave a Reply

Your email address will not be published. Required fields are marked *