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)
Javascript compression
-
- Posts: 82
- Joined: Sun May 11, 2008 2:17 pm
- Location: Los Angeles, CA
- Contact:
Re: Javascript compression
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
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
Dan Ciliske
Project Engineer
Netburner, Inc
Project Engineer
Netburner, Inc
Re: Javascript compression
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
I'd just feed my .js files through this site to do the compression: http://shrinksafe.dojotoolkit.org/
Scott