Configuring Headers That Affect Dynamic
Response Compression
The Web Container Service provides an option for configuring two HTTP headers that determine (when they are present in the header part of the message) whether or not the response generated by your servlet or JSP is compressed with the gzip mechanism. The use of these headers overrides the general compression rules that you have configured in the HTTP Provider Service.
For more information about the rules for compressing HTTP messages that you can configure, see Configuring Rules for HTTP Responses Compression.
The headers that prevent or force the compression of servlet and JSP responses are never really sent to the client; rather, they facilitate the inbound communication between the Web Container Service and the HTTP Provider Service. It is the responsibility of the HTTP Provider Service to remove the headers before it sends the response back to the client.
You configure the headers with the following properties of the Web Container Service:
· HeaderForNoCompression
This header prevents dynamic responses from being compressed, even if they should be according to the compression rules you have set in the HTTP Provider Service.

By default, the header that prevents response compression has the name No-Compress. If you set this header to the response in your servlet or JSP using the response.setHeader(“No-Compress”, “true”);statement before committing the response or writing to the output stream, then this response will not be compressed.
· HeaderForCompression
This header always forces the compression of dynamic responses (regardless of the compression rules in the HTTP Provider Service). The use of this header name in the code of your servlet or JSP is analogous to the one presented in the example above.
You can use the Visual Administrator tool only to configure the names of the headers that affect the compression of dynamic servlet or JSP responses. Proceed as follows:
...
1. Open the Properties tab of the Web Container Service.
2. Enter the names of the headers as values of the HeaderForNoCompression and HeaderForCompression properties.
3. To add the new values to the list of properties, choose Update.
4.
To make your changes permanent, choose
(Save
Properties).