Sun Java System Web Server 6.1 SP11 NSAPI Programmer's Guide

Configuring HTTP Compression

When compression is enabled in the server, an entry gets added to the obj.conf file. A sample entry is shown below:

Output fn="insert-filter" filter="http-compression" type="text/*"

Depending on the options specified, this line might also contain these options:

vary="on" compression-level="9"

To restrict compression to documents of only a particular type, or to exclude browsers that don’t work well with compressed content, you would need to edit the obj.conf file, as discussed below.

The option that appears as:


restricts compression to documents that have a MIME type of text/* (for example, text/ascii, text/css, text/html, and so on). This can be modified to compress only certain types of documents. If you want to compress only HTML documents, for example, you would change the option to:


Alternatively, you can specifically exclude browsers that are known to misbehave when they receive compressed content (but still request it anyway) by using the <Client> tag as follows:

<Client match="none"\
browser="*MSIE [1-3]*"\
browser="*MSIE [1-5]*Mac*"\
Output fn="insert-filter" filter="http-compression" type="text/*"

This restricts compression to browsers that are not any of the following: