One of the advantage of this approach is that your application server does not have to know anything about GZIP and you can simply configure Http Server to decide what type of files to compress, enable compression trace, exclude browsers that bugs from compression, exclude URL's or file extensions that should be excluded from compression, configure your proxy to handle compression.
The Apache Http Server(IBM Http Server is based on Apache Http Server) has mod_deflate module that can be used to configure compression.
You can enable Http Compression at Apache level by opening HTTPServerRoot/conf/httpd.conf and adding these lines to it
LoadModule deflate_module modules/mod_deflate.so
AddOutputFilterByType DEFLATE text/html text/plain text/xml
The AddOutputFilterByType directive activates a particular output filter for a request depending on the response MIME-type. In our example it is applying mod_deflate to response where content-type is either text/html, text/plain or text/xml. The DEFLATE filter will compress the output before sending it to the client.
Enabling filters with AddOutputFilterByType may fail partially or completely in some cases. For example, no filters are applied if the MIME-type could not be determined and falls back to the DefaultType setting, even if the DefaultType is the same. SO there is another more complex and powerful way in which we can configure mod_deflate
# Insert filter
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0 no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary