Posted by : Deepak Vasudevan Sunday, April 15, 2007

JavaScript Crunchers

Great care is being taken by enterprises to safeguard thier intellectual properties. They also take greatest of pains in ensuring that the application is fast loading on all types of Internet Pipes. Nevertheless, there is one big open channel. JavaScript. Scripting content goes in plain text and with more amount of text content, they present a significiant load on the Internet pipe. While there are commercial solutions offered to even obfuscate and encrypt, they do present problems for cross browser decrypting and long term maintenance. The relative tradeoff and middle tier solution would be Crunching the JavaScript files.

I would like to share a few JavaScript crunchers over here:

  1. CFoster Javascript Cruncher
  2. Brainjar Cruchinator

We would here review in brief about them and the modus operani adopted therein.

  1. Simple parsing using regular expressions to remove comments
  2. Newlines are removed and hence the entire function now occupies a single line when done a ViewSource.
  3. Unnecessary Whitespaces are removed.

There are a few caveats using the crunchers. Since newlines are removed, scripts if they are not properly delimited by semicolon might break. Hence take a backup of those scripts before running a cruncher on them.

Popular Post

Blogger templates


Blog Archive


Blog Archive

Powered by Blogger.

- Copyright © Lavanya Deepak -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -