Sun Java System Web Server 6.1 SP10 Administrator's Configuration File Reference

Output

All Output directives are executed when the server or a plug-in first attempts to write entity body data from the client.

The Output stage allows you to select filters that will process outgoing data.

You can add NSAPI filters that process outcoming data by invoking the insert-filter SAF in the Output stage of the request-handling process. The Output directives are executed at most once per request.

You can define the position of a filter within the filter stack. For example, filters that translate content from XML to HTML are placed higher in the filter stack than filters that compress data for transmission. You can use the filter_create function to define the filter's position in the filter stack and the init-filter-order to override the defined position.

When two or more filters are defined to occupy the same position in the filter stack, filters that were inserted later will appear higher than filters that were inserted earlier.

The following Output-class functions are described in detail in this section:

http-compression

The http-compression filter compresses outgoing content. If the client does not support compression, or the outgoing content is already compressed, http-compression performs no action.

Unlike the find-compressed SAF, the http-compression filter can compress dynamic content such as the output from SHTML pages, CGI programs, or JSPs. However, for reasons of efficiency, the find-compressed SAF is better for static content such as non-parsed HTML files. For more information, see find-compressed.

Parameters

The following table describes parameter for the http-compression filter.

Table 4–41 http-compression Parameter

Parameter 

Description 

vary

Controls whether the filter inserts a Vary: Accept-encoding header. If vary is absent, the default value is yes. yes tells the filter to insert a Vary: Accept-encoding header when it compresses content. no tells the filter to never insert a Vary: Accept-encoding header.

fragment-size

Size in bytes of the memory fragment used by the compression library to control how much to compress at a time. The default value is 8096. 

compression-level

Controls the compression level used by the compression library. Valid values are from 1 to 9. A value of 1 results in the best speed. A value of 9 results in the best compression. The default value is 6. 

window-size

Controls an internal parameter of the compression library. Valid values are from 9 to 15. Higher values result in better compression at the expense of memory usage. The default value is 15. 

memory-level

Controls how much memory is used by the compression library. Valid values are from 1 to 9. A value of 1 uses the minimum amount of memory but is slow. A value of 9 uses the maximum amount of memory for optimal speed. The default value is 8. 

Example


Output fn="insert-filter"
type="text/*"
filter="http-compression"
vary="on"
compression-level="9"

In this example, type="text/*" restricts compression to documents that have a MIME type of text/* (for example, text/ascii, text/css, text/html, and so on).

Alternatively, you can specifically exclude browsers that do handle compressed content well by using the Client tag as follows:


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

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

Internet Explorer on Windows earlier than version 4 may request compressed data at times, but does not correctly support it. Internet Explorer on Macintosh earlier than version 6 does the same. Netscape Communicator version 4.x requests compression, but only correctly handles compressed HTML. It does not correctly handle linked CSS or JavaScript™ from the compressed HTML, so administrators often simply prevent their servers from sending any compressed content to that browser (or earlier).

insert-filter

Applicable in Output-class directives.

The insert-filter SAF is used to add a filter to the filter stack to process outgoing (server-to-client) data.

The order of Input fn="insert-filter" and Output fn="insert-filter" directives can be important.

Returns

Returns REQ_PROCEED if the specified filter was inserted successfully, or REQ_NOACTION if the specified filter was not inserted because it was not required. Any other return value indicates an error.

Parameters

The following table describes parameters for the insert-filter function.

Table 4–42 insert-filter Parameters

Parameter  

Description  

filter

Specifies the name of the filter to insert. 

bucket

(Optional) Common to all obj.conf functions.

Example


Output fn="insert-filter" filter="http-compression"

         

match-browser

Applicable in all stage directives. The match-browser SAF matches specific strings in the User-Agent string supplied by the browser, and then modifies the behavior of Sun Java System Web Server based upon the results by setting values for specified variables. See match-browser.

remove-filter

Applicable in Input-, Output-, Service-, and Error-class directives.

The remove-filter SAF is used to remove a filter from the filter stack. If the filter has been inserted multiple times, only the topmost instance is removed. In general, it is not necessary to remove filters with remove-filter, as they will be removed automatically at the end of the request.

Returns

Returns REQ_PROCEED if the specified filter was removed successfully or REQ_NOACTION if the specified filter was not part of the filter stack. Any other return value indicates an error.

Parameters

The following table describes parameters for the remove-filter function.

Table 4–43 remove-filter Parameters

Parameter  

Description  

filter

Specifies the name of the filter to remove. 

bucket

(Optional) Common to all obj.conf functions.

Example


Output fn="remove-filter" filter="http-compression"

         

set-variable

Applicable in all stage directives. The set-variable SAF enables you to change server settings based upon conditional information in a request and to manipulate variables in parameter blocks by using specific commands. See set-variable.