DCSIMG
Get better performance when using JavaScript files - Pini Dayan

Pini Dayan

The best thing about a boolean is even if you are wrong, you are only off by a bit.

Get better performance when using JavaScript files

One of the greatest things you can find out if you look deep into Microsoft Ajax framework is that there are 2 copies of each JS file that is part of the Assembly: System.Web.Extentions that is the main assembly in the framework. If the reflector if looks like this:

 

image

There are 2 copies of every js file since one is for debug and one is for release. If you take a closer look and open the debug one you will find out that the debug version is with comments, line breaks and a very readable code. The non debug mode file is with no comments , not line breaks and very trimmed.To understands here is a part of this file:

image

 

So this gives a very good ideas to us web developers. Whenever we have a bandwidth problems or whenever we wish to get better performance by minimizing the size of our js files. So how do we do this? Very simple. check out this web site JSMIN and download the utility that does exactly that.

This utility was built by Douglas Crockford.

Enjoy.

Comments

Gil Fink said:

Hi,

You can also use YUI Compressor which does the same and also compress css files.

Go to the following link for more details:

developer.yahoo.com/.../compressor

# May 1, 2009 10:59 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: