сряда, 3 март 2010 г.

Compressing My JavaScript and CSS files

With the above two tips I managed to gain little over 2 seconds of load time on T1 connections and much more on 128K and 54K, but there is more to do. Every time we install new plugins we get a new CSS file that the plugin uses. Most of the times we don’t really even need these new CSS files so simply edit the plugin (if you know how to do that) and remove the functions that injects the javascript inside the < head > of our blog. The other method is to compress our javascripts and css files through the Minify Engine or you can use a wordpress plugin called WP Minify which actually grabs all your .js and .css files, sends them to the Minify Engine, compresses them and replaces the old codes with the new ones (safe to use).

After I compressed my javascripts and css files my load time decreased even more, and this are the results I have now:

* 56K connection: 160.17
* ISDN 128K: 52.11
* T1 1.44Mbps: 8.54

Impressive no? Now my site load time dropped to 8.44 seconds from a heavy 11.71 (more then 3 seconds gained). There are few more times that can be done to decrease yourwebsite load time but since I haven’t tested them yet I won’t mention them (perhaps I will update this post with the results). There are other factors that influence theload time of your website, such your web hosting. There is a good list of hosting comparison here at Astrit’s blog.

Now that you finished reading these 3 simple ways how you can decrease the load time of your site, go over and apply these techniques to your wordpress blog and come back, let me know about your results (I am eager to know), then tell your friends about it so they can benefit too. How much seconds did you gained?

Няма коментари:

Публикуване на коментар