Minify And Compress Your CSS and Javascript

Website performance effect SEO (Search Engine Optimization), and beside that it’s more convenient to your visitor to read your website if your website loading time is short. There are lot of ways to improve and optimize your website performance. One of them is compress and minimized your CSS and javascript.

This two static files are usually use in modern website, either to increase usability and make it your homepage beautiful. But often this two static files (CSS and Javascript) have lot of empty spaces which make your file size larger and waste bandwidth. Compressed and minimized CSS and Javascript are two important value in Google Page Speed tools to evaluate your website performance. Higher score means better performance.

There are lot of tools to minify and compress css and javascript files. Two which are the best for me is CSS Compressor and Javascript Compressor. CSS Compressor and Javascript compressor offer you free of charge service. CSS Compressor can help you to minify, optimize and compress your css files and give you many options to make your optimized css better. What you have to do is open all your css files, copy and paste it on their website, and choose Highest compression. Same goes to Javascript compressor, all you have to do is copy and paste all your javascript and compress it.

After all process are finished, it left you only 1 css file and 1 javascript file, which are optimized. You can replace your website css and javascript with just 2 files. This will improve your website perfrormance, since the file size is much smaller that will decrease downloading time and save bandwidth.

So in the end, what you get from minify your CSS and Javascript are save bandwidth, faster loading time, increase site performance. So what are you waiting for? Have you minify and compress your css and javascript files?

CSS Compressor
Javascript Compressor

Comments

  1. Voku says:

    1.)
    cat datei1.js > alle_dateien.js
    cat datei2.js >> alle_dateien.js
    cat datei3.js >> alle_dateien.js

    2.)
    cd /usr/src/
    wget http://yuilibrary.com/downloads/yuicompressor/yuicompressor-2.4.2.zip
    unzip yuicompressor-2.4.2.zip
    rm yuicompressor-2.4.2.zip
    cd yuicompressor-2.4.2build
    sudo aptitude install sun-java6-bin

    3.1.)
    java -jar yuicompressor-2.4.2.jar –type js -o combined.js alle_dateien.js alle_dateien_klein.js

    3.2.)
    java -jar yuicompressor-2.4.2.jar –type css -o combined.css alle_dateien.css alle_dateien_klein.css

    -> http://suckup.de/blog/2010/07/26/webseiten-komprimieren/ (German)

  2. Nice trick voku. Thanks.

  3. rabbit says:

    Nice article! If you use ASP.NET, check this out:
    http://www.codeproject.com/KB/aspnet/CombineAndMinify.aspx

  4. Davidskimve says:

    You can also use Smaller to to batch minify CSS and JavaScript files
    http://smallerapp.com

Give me your feedback

This site uses Akismet to reduce spam. Learn how your comment data is processed.