WebAppers

/ best free open source web resources /

Shopify

Boost Website Load Time with Javascript CSS Compressor

Posted · Category: Code, LGPL License, Tools

One of the keys to getting your pages to load quicker is to make fewer HTTP requests. So, for example, if you have 6 javascript files it would be much quicker for you to join all the JavaScript together into one file and serve that instead. You can decrease the loading time further by minify your JavaScript, CSS and HTML. And also, by gzipping your page’s components and adding a far-future expires header can make your pages load faster as well.

However, doing all these manually is a pain. Aciddrop has set up a PHP script to automatically do them for you. On the test page the load time with the compressor turned on was generally below second, and without the compressor between 3-5 seconds. The Yahoo Yslow rating went from F(45) to A(97) as well.

Requirements: PHP 4+
Demo: http://aciddrop.com/2008/01/21/boost-your-website-load-time…
License: LGPL License

8 Comments
  • msznapka

    The better solution is to minify, join and gzip JavaScript and CSS files during building or deploying the project, not with some PHP script which slows your HTTP response. I am using YUI Compressor maven plugin.

    From my tests, gzipping HTML result during HTTP response is additional load to server, moreover with lot of requesting clients. And that is not good way.

  • http://www.ibnoe.web.id ibnoe

    Very Nice resource

  • http://ala.mihanblog.com AliReza

    nice thing !

  • http://free-iphone-apple.blogspot.com mark

    Seems useful.

  • Pingback: Tu página carga más rápido con Javascript CSS y HTML reducido « Webadentro

  • http://www.queroveiculos.com.br/ Carro Brasília

    I preffer to compress/pack javascript/css and send in the same page.
    Compressing javascript ou css using gzip cause problem with IE6.

  • Jün

    I used minify (http://code.google.com/p/minify/) and it works awesome – same concept.

  • http://radioactive.sg yohan

    @msznapka : +1
    This type of technologies is similiar to google page speed / page optimiser that they released a few months ago. It sounds great but it did kill my servers by compressing the code, html and such at request time.
    I switched to pre-combination and minification of the CSS and JS using a combination of Yahoo and Google compilers as well as some custom tools and it worked much better !

    Plus php performance will likely be lesser than the Google compiler solution unless the php opcode is cached.

    So anybody looking for a silver bullet better start doing it themselves as these kind of framework is a no go for high traffic websites. But good tentative nonetheless.

Supported By

Deals

Web Browsers Icon Set
Food Icon Set
Flat Icon Set

Flat Icon Set

100 icons