Page 1 of 1

Javascript compression

Posted: Sat Apr 12, 2014 2:18 pm
by thomastaranowski
Has anyone tried serving up compressed javascript on their web heavy Netburner applications? It doesn't appear as though the javascript code is compressed in any way, a 90k JQuery package really eats into my flash budget.

As as aside, what are folks generally using for 2d line graphs? I was just going to pull in d3.js to do it the easy way, but it's a 140k file (only ~40k compressed)

Re: Javascript compression

Posted: Mon Apr 14, 2014 9:10 am
by dciliske
Can you tell me what the line beginning ".js" is in your MIME_magic.txt file is in 'pcbin'? This file tells the comphtml/decomphtml subsystems how to (de)compress and serve up files built into the application image.

If the line has a '1' in it then '.js' files found in the 'html' directory of you project are being compressed in the image. If you do not have this file, then you are running an older release (pre March, 2012) that does not support compression of arbitrary file types.

[Edit] As for graphing, there is an example in the 'Web' examples called 'Ajax Graph' which uses the dygraph library, which gets compressed down to 40K, so none better than d3 :/
-Dan

Re: Javascript compression

Posted: Tue Apr 22, 2014 12:56 am
by sblair
I ran into the same problem when I was on the 5270 with javascript libs. I found I could compress them down quite a bit with no issue.

I'd just feed my .js files through this site to do the compression: http://shrinksafe.dojotoolkit.org/

Scott