The find-compressed function checks if a compressed version of the requested file is available.
If the following conditions are met, find-compressed changes the path to point to the compressed file:
A compressed version is available.
The compressed version is as recent as the non-compressed version.
The client supports compression.
Not all clients support compression. The find-compressed function allows you to use a single URL for both the compressed and non-compressed versions of a file. The version of the file that is selected is based on the individual client's capabilities.
A compressed version of a file must have the same file name as the non-compressed version but with a .gz suffix. For example, the compressed version of a file named /httpd/docs/index.html would be named /httpd/docs/index.html.gz. To compress files, you can use the freely available gzip program.
Because compressed files are sent as is to the client, you should not compress files such as SHTML pages, CGI programs, or pages created with JavaServer PagesTM (JSPTM) technology that need to be interpreted by the server. To compress the dynamic content generated by these types of files, use the http-compression filter.
The find-compressed function does nothing if the HTTP method is not GET or HEAD.
The following table describes parameters for the find-compressed function.
Table 7–19 find-compressed Parameters
Parameter |
Description |
---|---|
(Optional) Specifies whether to check if the compressed version is older than the non-compressed version. The values can be yes or no.
By default, the value is set to yes. |
|
(Optional) Specifies whether to insert a Vary: Accept-Encoding header. The values can be yes or no.
By default, the value is set to yes. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
<Object name="default"> NameTrans fn="assign-name" from="*.html" name="find-compressed" ... </Object> <Object name="find-compressed"> PathCheck fn="find-compressed" </Object>