Javascript compression

Discussion to talk about software related topics only.
Post Reply
thomastaranowski
Posts: 82
Joined: Sun May 11, 2008 2:17 pm
Location: Los Angeles, CA
Contact:

Javascript compression

Post 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)
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Javascript compression

Post 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
Dan Ciliske
Project Engineer
Netburner, Inc
sblair
Posts: 162
Joined: Mon Sep 12, 2011 1:54 pm

Re: Javascript compression

Post 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
Post Reply