I am doing issues about script compression. Following is what I just found in stackoverflow:
"If you are using it in a webpage, gzip is a configuration method in your web server. The file is gzipped by the server, sent to the browser. No manual action is needed. For Apache: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html.
If you are delivering the code to developers, you could use the gzip command."
Someone told me that if such script compression strategy is used, it will make you very easy to debug:
When you use Firebug to debug javascript in run time, the script you see is the original, uncompressed one, which is much readable.
But if you use the YUI compressor, the script shown in Firebug will be something like this:
var is_moz=(typeof document.implementation.createDocument!="undefined");var is_chrome=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;var selectedTreeNodeIdInOper="";var selectedTreeNodePkInOper="";var winDef="width=490,height=190,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyh....
Which is just in a horizontal line and hard to read.
My question is that how can gzip in tomcat send the compressed scripts to the clients meanwhile show the developer the original script? Magic?