Will I benefit from Gzipping my script files? Also, are the size on disk and gripped size equal for a script file I am serving?
Any static content that goes over the network will almost always benefit from being compressed. Dynamic content, however, will A) use CPU on the server side where it is precious and B) open you up to cryptographic attacks like BREACH/CRIME.
You will never find a better article than this on css tricks, where all the good things on gzipping are explained. There's also a comparative between gzip and minification and why you should use both or one, or none (both, the answer always is both ;)). In a nutshell, gzip return to the browser a file version with "pointers" to the first instance of a strings; so if you have many divs, instead of sending the textual <div> it will return a reference to the first instance, this reduce significantly the file size that the end user receives. I hope you understand the concept and the benefits of gziping
Samuel Oloruntoba
Java is to JavaScript what Car is to Carpet.
First let me explain how gzip works. When a user navigates to a page lets call this page
index.html, the browser then sends a request to the server - normally the file that was requested would be returned. But, if you have gzip enabled on your web server, the server does not returnindex.html, it returnsindex.html.gzwhich the browser downloads and decompresses. Gzipping is like sending a zip file of a much larger file.The answer to your question is yes and in a positive way. There was a project I worked on a while ago, I used react js - the resulting file after browserify was about 3mb, I minified the source code and it reduced to about 200kb. I enabled gzip on my server and the file was just over 40kb. All the javascript required to run the site was just 40kb.