7 Ways to Boost Your Page Load Time Using CSS and JavaScript

Everybody has less and less time today for surfing, chatting, spending time on social media or whatever they like to do on the internet. Slow loading speeds disappeared a long time ago and we don’t want to see blogs and web pages taking too much out of our already limited time. You can find many tools on the internet to help you improve your web pages’ loading speed and I took a look at many of them, so I am able to recommend you the following ones, which mainly work by eliminating the poorly written code.

1. Site Load Test

This one mainly works like a validator, but tells you more about each error you have. Although it has quite a few errors, 1stwebdesigner.com got a general loading time of 1.88 seconds, which is very good according to the standards, which say that a page should load within a maximum of four seconds.

Site Load Test will not do wonders for you, but will help you get rid of those tiny little errors you didn’t think about. It also helps you find errors regarding uploaded files, websites’ size and total objects to load, not only CSS and JavaScript mistakes you’ve made while coding. Note that this is not an application that will automatically remove the errors – you will have to do it yourself.

2. Packer

If you are a JavaScript developer or you want to use a JavaScript code in your webpage, Packer is what you need. It will not create the code for you, but it will compress it. This tools works very fast and very well. You only need to copy your original code into the top field and then click on “Pack”. Within a few seconds you will get the new code (which basically does the same as the original one), but in a different state. The compressed code will not generate errors and, as you all know, less code is less size and therefore faster loading time.

3. SquishIt 

SquishIt is a GitHub trademark and helps you a lot as well. When you have both CSS and JavaScript in your website (which is pretty much most of the time you code), this tool will “bundle” both of them into one file, making the number of files that need to load smaller. Although this tool might be a bit difficult to use due to the poor interface, once you play with it once or twice you will see it actually can be useful.

SquishIt can help with much more thanks to the Google Group and the discussion forum it features. You can talk about way more than CSS and JavaScript there, ask for advice and opinions and then code properly.

4. Minify 

Minify Logo and Description

This one is a PHP5 application that helps you with your CSS and JavaScript. What is does is that it combines several CSS and JavaScript files removing white space and comments and exports them with gzip encoding and optimal client-side cache headers.

Basically, if you have 5 JavaScript files, they will all become one after you use Minify. The app is easy to use, eliminates HTTP requests and reduces CSS/JavaScript bandwidth by 70%.

The app is integrated in other projects as well. If you run WordPress, there are two plugins which enjoy the same features: WP Minify and W3 Total Cache.

5. JSMin 

JavaScript Minifier works pretty much as Minify, only it does not combine multiple files together. The only thing it does is that it removes the white space and comments from a JavaScript page. The official website of the tool says the app helps reduce the file size by half and encourages a more expressive programming style. JavaScript Minifier does not modify anything else in your code and it will not ruin it, so that the script will run properly.

6. Google Closure Compiler

Google’s tool is another one that basically cleans your code to allow faster loading time. This tool, however, does efficiently correct and remove a wide range of common coding errors in JavaScript.

The Compiler includes a huge JavaScript library, tested on several browsers and computers, a style checker and fixer and a JS optimizer. Google’s tool is very powerful and works perfectly, tidying up each of your JavaScript pages until nothing else can be done to it.

7. YUI Compressor 

YUI Compressor Logo

Although Yahoo! has fallen behind lately, their developer network still does a bit of a good work. YUI Compressor is one of their products which, as the name says, compresses your files fast and safe. YUI works both with CSS and JavaScript and proclaims itself as being better than competitors such as Packer or JSMin (presented above). The goal of the application is to preserve the qualities of the code and to only modify what is not working properly.

With Yahoo’s tool we end the list of CSS/JavaScript compressors which help your page load faster. Most of them are very easy to use and you won’t even have to spend much time optimizing your page, but it is a good idea to do it before uploading the final version of the site. Don’t forget that loading time is very important for both you and the visitors and not being able to hold a high standard might not help you too much. Therefore you should try out each of these tools and see which one of them works better for you.

Further reading

Speed Up Your Page With Google Analytics on WebMonkey

5 Tools to Speed Up your Website on RackAid

Tools to Speed Up Your Site on SEO Gadget

Christian Vasile

Christian Vasile is an enthuziastic Romanian web designer currently living in Denmark. He is passionate for the industry and writes about design, usability, coding and freelancing and is a regular publisher here at 1WD. You can follow him on Twitter at @christianvasile or visit his web portfolio by clicking on the link above.

15 Smart Tools To Help You Build Your Freelance Business

Discover the awesome tools we use in making our clients comfortable and happy in learning new things every day.

Download Now

Comments

  1. Aqeel says

    Minify is a good tool. You can also consider about the phptidy libray, which will cleanup the markup and reduce page size too.

  2. deadwin says

    This is such a nice article i am using some of these stuff but now will try all of those.

  3. says

    I like to use pingdomtools to see which element take long time to load and the detail of all element within a page. thanks for your list :)

  4. Fred says

    Really nice tools and very helpful because sometimes it becomes to tedious to wait for the site loading.

  5. Wayne says

    Christian Vasile thanks for suggest these tools…but can you suggest best page speed checker tools so we can easily check our page’s speed.

  6. Andrew Groat says

    Thanks Christian,

    I’ve been exploring options for improving the efficiency of a webapp for a company, so these will be handy.

    It’s a large scale financial software with over 20 HTTP requests :-S Ouch!

  7. Ryan says

    My afterthought: JSLint code quality tool. Got triggered by the “Google Closure Compiler” ;)

  8. Ryan says

    For the more .net inclined users on here I would recommend the Microsoft AJAX minifier. Minifies js and css. Beauty of it is you can integrate it into your build process. YUI min is my compressor of choice but if you are using .net I would certainly recommend Microsoft’s version.

  9. Luiz Felipe says

    Very good article.
    Thanks.

    PS.: Please, add share button on the page, like Twitter, Facebook and G+.