NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

  • Comment on Compressing/Obfuscating Javascript file

Replies are listed 'Best First'.
Re: Compressing/Obfuscating Javascript file
by chromatic (Archbishop) on Oct 06, 2001 at 07:50 UTC
    If you're running Apache, installing mod_gzip would speed up more than just JavaScript, with less headache.

    There may be a similar solution for other web servers, but I'm not aware of it. (Doesn't mean it would be difficult to write, if you have access to some rewriting rules based on accept headers.)

Re: Compressing/Obfuscating Javascript file
by BrentDax (Hermit) on Oct 07, 2001 at 06:03 UTC
    The "magical regex" you seek is really a magical module--Text::Balanced by Damian Conway (TheDamian). extract_codeblock, although designed for Perl and not JavaScript, should probably do the trick.

    =cut
    --Brent Dax
    There is no sig.