org.riotfamily.cachius.servlet
Class ZippedResponseHandler
java.lang.Object
org.riotfamily.cachius.servlet.SessionIdCacheHandler
org.riotfamily.cachius.servlet.ResponseCapturingHandler
org.riotfamily.cachius.servlet.ZippedResponseHandler
- All Implemented Interfaces:
- CacheHandler
- Direct Known Subclasses:
- ControllerCacheHandler
public abstract class ZippedResponseHandler
- extends ResponseCapturingHandler
Abstract CacheHandler that supports zipped content.
- Author:
- Felix Gnass [fgnass at neteye dot de]
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZippedResponseHandler
public ZippedResponseHandler(HttpServletRequest request,
HttpServletResponse response,
CacheKeyAugmentor cacheKeyAugmentor)
setMinSize
public void setMinSize(int minSize)
shouldZip
protected boolean shouldZip()
responseShouldBeZipped
protected abstract boolean responseShouldBeZipped()
isZip
protected boolean isZip()
augmentCacheKey
protected void augmentCacheKey(StringBuffer key)
- Overrides:
augmentCacheKey
in class SessionIdCacheHandler
postProcess
protected final void postProcess(CacheItem cacheItem)
throws IOException
- Overrides:
postProcess
in class SessionIdCacheHandler
- Throws:
IOException
responseCanBeZipped
protected boolean responseCanBeZipped()
- Checks whether the response can be compressed. This is the case when
the client accepts gzip
encoded content
, the user-agent has no known gzip-related bugs
and the request is not an
include request
.
clientAcceptsGzip
protected boolean clientAcceptsGzip()
- Returns whether the Accept-Encoding header contains "gzip".
userAgentHasGzipBugs
protected boolean userAgentHasGzipBugs()
- Returns whether the User-Agent has known gzip-related bugs. This is true
for Internet Explorer < 6.0 SP2 and Mozilla 4.06, 4.07 and 4.08. The
method will also return true if the User-Agent header is not present or
empty.