org.apache.tapestry5.services
Interface ResponseCompressionAnalyzer

All Known Implementing Classes:
ResponseCompressionAnalyzerImpl

@UsesConfiguration(value=java.lang.String.class)
public interface ResponseCompressionAnalyzer

Used to determine if the client supports GZIP compression of the response.

The configuration is an unordered list of content types that should not be compressed.

Since:
5.1.0.0

Method Summary
 boolean isCompressable(String contentType)
          Checks to see if the indicated content type is compressable.
 boolean isGZipSupported()
          Checks the Accept-Encoding request header for a "gzip" token.
 

Method Detail

isGZipSupported

boolean isGZipSupported()
Checks the Accept-Encoding request header for a "gzip" token.

Returns:
true if gzip is supported by client

isCompressable

boolean isCompressable(String contentType)
Checks to see if the indicated content type is compressable. Many formats are already compressed; pushing them through a GZip filter consumes cycles and makes them larger.

Contribute content type strings to the service's configuration to mark them as not compressable.

Parameters:
contentType - the mime type of the content, such as "text/html" or "image/jpeg".
Returns:
true if compression is worthwile


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.