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:
We would here review in brief about them and the modus operani adopted therein.
- Simple parsing using regular expressions to remove comments
- Newlines are removed and hence the entire function now occupies a single line when done a ViewSource.
- 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.
No comments:
Post a Comment