I have to deploy a heavily JS based project to a embedded device. Its disk size is no more than 16Mb. The problem is the size of my minified js file all-classes.js is about 3Mb.  If I compress it using gzip I get a 560k file which saves about 2.4M. Now I want to store all-classes.js as all-classes.js.gz so I can save space and it can be uncompressed by browser very well. All I have to do is handle the headers. 
Now the question is how do I include the .gz file so browser understands and decompresses? Well i am aware that a .gz file contains file structure information while browser accepts only raw gzipped data. In that I would like to store the raw gzipped data. It'd some sort of caching!
What you need to do, when the "all-classes.js" file is requested, is to return the content of "all-classes.js.gzip" with the additional "Content-Encoding: gzip" HTTP header.
But it's only possible if the request contained the "Accept-Encoding: gzip" HTTP header in the first place...
Use compressed JavaScript file (not run time compression)