[aklug] Re: Removing newlines from minified javascript

From: Tim Johnson <tim@akwebsoft.com>
Date: Thu Aug 09 2012 - 10:18:10 AKDT

* Royce Williams <royce@tycho.org> [120808 18:29]:
> I'm injecting myself late into this thread ... but a couple of
> questions and points:
>
> * How much space savings are you seeing from stripping the newlines?
> Can you post actual size, before and after?
 Stripping the newlines left by jsmin is *no* space savings. Because
 the newlines are replaced by spaces.
> * How many JavaScript-loading URLs are you loading per page? Just the
> one, or multiple?
  Multiple.
> * Perhaps the simple jsmin pass (maybe coupled with compression on the
> server side) would be easier?
  I understand compression on the server side but don't understand
  "jsmin pass". Can you clarify?
  
> * Unless you're dynamically generating/altering the JavaScript, won't
> it be relatively static (and therefore only loaded on first visit)?
  Should be, but I think that could vary with the user's browser
  settings.
> * If you're worried about page load times, are you loading the
> JavaScript asynchronously?
  No. Not there yet.
  Load times are not a big deal and it wasn't my concern for
  introducing this question. I asked this question for 3 reasons:

  1)General edification because sometimes asking questions of on
  issue can clarify other issues. I.E. Michael bring up the IE-style
  multi-line strings.

  2)HMBFIHM (help me before I hurt myself) - When it comes to
  javascript, which as we know runs inside of the user's
  interpreter, I figure it is better to ask permission than to ask
  forgiveness.

  3)The compression provided by jsmin has as a side effect
  obfuscation and I think my customer is going to ask for some
  obfuscation.
 
  Based on the input from this thread, I won't be further modifying
  the files that jsmin produced. I'm going to rely on Crockford's
  decision as the best one, and not tamper with it.
 
  And I believe that even tho the Crockford approach does not alter
  symbol names, it will be enough obfuscation to make the client
  happy.
  
  Thanks

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu Aug 9 10:18:18 2012

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2012 - 10:18:18 AKDT