About caching compressed content

Microsoft Forefront Threat Management Gateway includes a compression feature. HTTP compression is a global HTTP policy setting. For outbound traffic, it applies to all HTTP traffic that passes through Forefront TMG to or from a specified network or network object. In Web publishing, compression is configured for a Web listener. HTTP compression is provided by the following two Web filters:

  • Compression filter—This filter is responsible for compression and decompression of HTTP requests and responses. This filter has a high priority and is high in the ordered list of Web filters. This is because the filter is responsible for decompression. Decompression must take place before any other Web filters inspect the content.
  • Caching compressed content filter—This filter is responsible for caching of compressed content and serving a request from the compressed content in the cache. This filter has the lowest priority and is low in the ordered list of Web filters, because caching can take place after all other filters have handled the content.

Caching and compression work together to provide more efficient serving of compression requests. Note the following information:

  • Content is cached in one of the following formats:
    • Compressed—Content is requested in compressed format and cached in compressed format.
    • Uncompressed—Content is requested in uncompressed format and cached in uncompressed format.
    • Uncompressed and incompressible—If a client requests compressed content and it arrives at the cache uncompressed, it is stored in the cache as incompressible. The next time the request for the same compressed content is received, Forefront TMG recognizes that the content is incompressible and serves it from the cache uncompressed rather than from the Internet. Content that is inspected is also stored as uncompressed.
  • Compression settings applied to cached content are persistent. If you want compression configuration changes to be reflected in the cached content, you must first clear the cache. For instructions, see Deleting the cache.
  • When inspecting incoming compressed content, Forefront TMG Web filters decompress the content. Content is cached as decompressed text. If Forefront TMG receives a request for the cached content, it recompresses the content before sending, which increases response time.