public class CompressionFilter extends BaseFilter
This filter requires isomorphic_compression.jar to be present in your WEB-INF/lib to work properly.
Please contact Isomorphic (http://forums.smartclient.com) to learn more about the Network Performance package.
|Modifier and Type||Field and Description|
| || |
Comma separated list of mime types that are compressable.
| || |
Minimum size of the dynamically captured buffer (in bytes) for compression to kick in.
|Modifier and Type||Method and Description|
| || |
Is a specific request context compressable? Default implementation will disallow compression for messaging requests (determined by looking at the target request path).
public int compressThreshold
Default is 250 Bytes.
public java.util.List compressableMimeTypes
The CompressionFilter asks the container for the mimeType of the intercepted URL before bufferring. If the mimeType is known at that time and does not match this list of mimeTypes, the CompressionFilter avoids bufferring the response.
If the mimeType is unknown, the CompressionFilter buffers the response in the hope that the upstream servlet/filter will set the mimeType. If the mimeType is still unknown or does not match this list of mimeTypes, the response will not be compressed.
For optimal performance, you should ensure that the CompressionFilter only buffers responses that it can compress. You can do this by:
Note that if you wish to add extensions to the default list, you should test them against your target browser platforms to ensure that the compression will actually work for that mimeType.
Also, make sure that what you specify here matches what your container returns as the mimeType for the extensions you intend to compress. For example, if your container is configured to return
*.js files and you list only
text/ecmascript here then compression will be disabled for
The comparison is a substring match of the specified mimeType against what the container/response returns. So, for example, if you specified
public boolean canCompressContext(RequestContext context)