Sun Java System Web Server 7.0 Update 1 Administrator's Guide

Configuring the Server to Compress Content on Demand

You can also configure the server to compresses transmission data on the fly. A dynamically generated HTML page doesn’t exist until a user asks for it. This is particularly useful for e-commerce-based Web applications and database-driven sites.

To configure your server to compress content on demand, perform the following steps:

ProcedureTo Compress Content on Demand

  1. From the virtual server page, click the Content Handling tab.

  2. Click General sub tab. Go to Compress Content on Demand section under Compression section.

  3. Select from the following options:

    • On—Demand Compression — Enable/Disable on-demand compression for the selected resource.

    • Insert Vary Header — Specify whether to insert a Vary: Accept-encoding header.

      If selected, then a Vary: Accept-encoding header is always inserted when a compressed version of a file is selected.

      If not selected, then a Vary: Accept-encoding header is never inserted.

    • Fragment Size — Specifies the memory fragment size in bytes to be used by the compression library (zlib) to control how much to compress at a time. The default value is 8096.

    • Compression Level — Specifies the level of compression. Choose a value between 1 and 9. The value 1 yields the best speed; the value 9 the best compression. The default value is 6, a compromise between speed and compression.

  4. Click Save.

    Note –

    Using CLI

    For enabling compression on demand through CLI, execute the following command.

    wadm> enable-on-demand-compression --user=admin 
    --password-file=admin.pwd --host=serverhost --port=8989 --config=config1 
    --vs=config1_vs_1 --insertvaryheader=true 
    --fragment-size=100 --compression-level=5

    See CLI Reference, enable-on-demand-compression(1).