IIS HTTP Compression

IIS 7.0

[Note: This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

IIS 7 supports HTTP compression to provide faster transmission times and use less network bandwidth when it responds to client requests. HTTP compression is efficient. The performance cost of compressing and decompressing content is minor when compared to the bandwidth gained from sending compressed data across the network. IIS 7 implements the GNU zip (gzip) and DEFLATE compression schemes to compress application responses. Compression schemes can be applied to responses for static or dynamic content. Static content can be pre-compressed on a disk and served on request to compression-enabled browsers. Compression schemes applied to dynamic content are done on-the-fly, so responses generated by applications can be compressed in real time. IIS 7 has options for enabling HTTP compression settings for both static and dynamic content. These settings include compression type, scheme, strength, and maximum CPU usage.

IIS 7 implements HTTP compression in a DLL named Gzip.dll. This reference describes the functions required to implement alternative compression algorithms that IIS can call to process static and dynamic responses.

The following table lists the functions exposed by the IIS HTTP Compression API.




Compresses data.


Creates a new compression context.


De-initializes the compression scheme.


Destroys the compression context.


Initializes the compression scheme.


Resets the compression state.

IIS calls the compression functions in the following order:

  1. InitCompression

  2. CreateCompression

  3. Compress (until all of the data has been compressed)

  4. DestroyCompression

  5. DeInitCompression

Note   The IIS static compression module and the IIS dynamic compression module initialize and de-initialize the compression scheme independently by using calls to the InitCompression and DeInitCompression functions.