An optional feature is the LTM system’s ability to off-load HTTP compression tasks from the target server. All of the tasks needed to configure HTTP compression on the LTM system, as well as the compression software itself, are centralized on the LTM system.
The primary way to enable the HTTP compression option is by setting the Compression setting of an HTTP profile to Enabled. This causes the LTM system to compress HTTP content for any responses matching the values that you specify in the Request-URI or Content-Type settings of the HTTP profile.
If you want to enable HTTP compression for specific connections, you can write an iRule that specifies the HTTP:compress enable command. For more information, see Chapter 13, Writing iRules.
When HTTP compression is enabled on the LTM system, the LTM system executes a series of steps:
1. First, the LTM system reads the Accept-Encoding header of a client request, looks for specification of either the deflate or gzip compression method, and notes whether either method is marked as being preferred.
2. If the Keep Accept Encoding setting in the HTTP profile is set to Disabled, the LTM system then removes the Accept-Encoding header from the request and passes the request on to the server.
Managing HTTP and FTP Traffic
Configuration Guide for Local Traffic Management 6 - 11
Removing the Accept-Encoding header prevents the server from performing the HTTP compression and from inserting the Content-Encoding header into its response.
3. Upon receiving the server response, the LTM system inserts the Content-Encoding header, specifying the compression method that it has chosen to use. The LTM system chooses a compression method by looking for the specification of either the gzip or deflate compression method in the Accept-Encoding header of the client request. If the client request does not specify a compression method, the LTM system uses the deflate method to compress the response data.
4. Finally, the LTM system then compresses the response and sends it to the client. The client then reads the Content-Encoding header in the response, determines the compression method used, and uncompresses the data accordingly.
Using the LTM system HTTP compression feature, you can include or exclude certain types of URIs or files that you specify. This is useful because some URI or file types might already be compressed. Using CPU resources to compress already-compressed data is not recommended because the cost of compressing the data usually outweighs the benefits. Examples of regular expressions that you might want to specify for exclusion are .*\.pdf, .*\.gif, or .*\.html.
Table 6.6 shows the compression settings that you can specify within an HTTP profile. Configuring these settings means either specifying a value where no default value exists, or changing a default value.
Setting Description Default Value
Compression Enables or disables the HTTP compression feature. Disable
URI Compression Displays the settings for including or excluding certain Request-URI responses. Possible values are URI List or Not Configured.
Not Configured
URI List If the URI Compression setting is set to Enabled,
specifies the URI targeted for compression, as well as the types of responses to include for and exclude from URI compression.
No default value
Content Compression Displays the settings for including or excluding certain Content-Type responses. Possible values are Content List or Not Configured.
Not Configured
Content List If the Content Compression setting is set to
Enabled, specifies the type of content targeted for compression, as well as the type of responses to include for or exclude from content compression.
In the Include List box, default values are:
text/
application/(xml|x-javascript) Preferred Method Specifies the compression method that you want to
use to compress the esponse. Possible values are gzip and deflate.
gzip
Chapter 6
6 - 12
Before configuring an HTTP profile, it is helpful to have a description of the compression settings that you might want to change.
Minimum Content Length
Specifies the minimum length in bytes of a server response that is acceptable for compressing that response. The length in bytes applies to content length only, not headers.
1024
Compression Buffer Size
Specifies the maximum number of compressed bytes that the LTM system buffers before deciding whether or not to insert a Content-Length header into the response that specifies the compressed size.
4096
gzip Compression Level
Specifies the amount and rate of compression. 1 - Least Compression (Fastest)
gzip Memory Level Specifies the number of kilobytes of memory that the LTM system uses for internal compression buffers when compressing a server response.
8
gzip Window Size Specifies the number of kilobytes in the window size that the LTM system uses when compressing a server response.
16
Vary Header Enables or disables the insertion of a Vary header
into cacheable server responses.
Enabled
HTTP/1.0 Requests Enables or disables compression of responses to HTTP/1.0 client requests.
Disabled
Keep Accept Encoding When enabled, allows the target server to perform the HTTP compression instead of the LTM system.
Disabled
Browser Workarounds Implements browser workarounds. Disabled (unchecked)
CPU Saver Specifies, when checked (enabled), that the system
monitors the percent CPU usage and adjusts compression rates automatically when the CPU usage reaches either the CPU Saver High Threshold or the CPU Saver Low Threshold. The default setting is disabled.
Enabled (checked)
CPU Saver High Threshold
Specifies the amount of CPU usage that causes the system to change the amount of content being compressed, and the amount of compression being applied.
90
CPU Saver Low Threshold
Specifies the amount of CPU usage that causes the system to revert back to user-defined compression values.
75
Setting Description Default Value
Managing HTTP and FTP Traffic
Configuration Guide for Local Traffic Management 6 - 13