Compress Javascript and CSS to Optimize Your Blog

Add Your Comments

As your blog grows in popularity, you will undoubtedly be faced with the problem of increased traffic. You might ask: how on earth is that a problem? In terms of increased readers and possibly higher ad revenues, it is not, but you will also have to deal with the higher server loads and potentially slower website speed. One way to optimize your blog is to use a script to combine and compress your CSS and Javascript files.

How it works

Most modern websites use Javascript to add functionality such as animations and dynamic actions on pages that do not require reloading. They use CSS files to streamline their style across multiple pages. In both cases, it is better to keep this information in separate files (i.e. example.js and style.css) rather than inputting all of the code into the HTML file. You can further cut down on the server load by using a script like “Minify” to combine and compress multiple CSS and Javascript files, which many websites now have.

What to Use

Minify is a PHP web application that uses gzip (defalte) to compress and send the contents of the files. It also removes unnecessary spaces for the best possible optimization and smallest size. All modern web browsers can handle gzip deflation, so it is an ideal solution.

If you prefer not to install your own script, there are also some online services that will do it for you, such as:

For a manual approach to combining CSS and Javascript files, see this online tutorial.

Compress Javascript and CSS to Optimize Your Blog

Add Your Comments

You must be logged in to post a comment.