The gzipping you're talking about is invisible to the end user, and for that matter, to you as a developer. It's taken care of by your web server, and the client's web browser.
For IIS, you need to enable the GZip ISAPI extension (check around on this site for a how-to), and for Apache it's mod_deflate.
When the web browser has completed its request, but before sending it out into the wide world, it will gzip the content and put a special header in, so that the browser knows the content is compressed.
When the web browser receives the response, it then unzips the data, and reads the file. This is completely transparent to the end user.
You usually only want to use GZip on text files. There's no point in using it on images, as images are already heavilly compressed.
I noticed a drop from 90Kb page size (load time of approx 1 second) to about a 5Kb page size (load time, .4 seconds) when enabling GZip on all static content (CSS, Javascript, etc).
What you would find if you watched the packets with Wireshark and re-assembled them, you would request /index.html
, but the webserver would fetch /index.html
, GZip it into /index.html.gz
and send it off. Yhe web browser knows this and unzips it so that it's back to /index.html
, so when you go to View Source you see /index.html
, not /index.html.gz
Since the answer is somehow hidden in the question - here is the solution for nginx in a VirtualBox environment as standalone answer.
In your nginx config (usally /etc/nginx/nginx.conf) or vhost config file change the sendfile
parameter to off
:
sendfile off;
While sendfile
is at the heart of Nginx's fame (blazing-fast low-level static file serving efficiency) it might be a bane for local development, e.g. Javascripts that change often and need to be reloaded. Nonetheless Nginx sendfile is smart and probably isn't most people's issue; check your browser's "disable cache" options as well!
Best Answer
You might have to delete the application cache folder in /work/Catalina/localhost after changing the cachingAllowed flag.
Configuration can be introduced in server.xml as