Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-03-29 00:47:16

Wei
New member
Registered: 2005-03-16
Posts: 9

compressing the javascript

The javascript files are getting big and waste bandwidth on a production server, you can try to compress it by using

http://www.saltstorm.net/depo/esc/


Wei.

Offline

#2 2005-04-02 04:55:39

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: compressing the javascript

Thanks Wei,  some code refactoring and reduction is on the cards.  One day.  Sometime.  I've submitted a ticket with that link.  I suspect the code will have to be cleaned up before compression by ESC will work.


James Sleeman

Offline

#3 2005-05-12 14:24:13

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: compressing the javascript

I tested this one :
http://www.codeproject.com/csharp/JSCompress.asp

On the main Xinha .js file. I did NOT remove linefeeds, since there are lines in the JS files which apperantly needs some ;. But when optimizing the JS it saved 45% of the entire size, and it works fine.

So it seems that this script could be used to very easily compress the JS files if we need to. It simply removes all comments, and removes all whitespace.

Offline

#4 2005-06-12 23:51:51

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: compressing the javascript

In the past I found that most functions did not get broken when linefeeds were removed, just one or two.  That probably isn't true anymore. I used to crunch each function seperately and keep linefeeds between functions, so I could update them easily. If the function would break, I would leave in the required linefeed. I don't think I would go to that much trouble now...

Offline

#5 2005-06-20 15:38:55

kimss
Xinha Pro
From: Sweden
Registered: 2005-04-05
Posts: 99
Website

Re: compressing the javascript

mharrisonline wrote:

In the past I found that most functions did not get broken when linefeeds were removed, just one or two.  That probably isn't true anymore. I used to crunch each function seperately and keep linefeeds between functions, so I could update them easily. If the function would break, I would leave in the required linefeed. I don't think I would go to that much trouble now...

Just to be clear, all you need to do to keep linefeeds is just check the "keep linefeeds" button with this tool, so its really fast crunching the JS and keeping the linefeeds to be 100% sure not to break anything.

Offline

Board footer

Powered by FluxBB