|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.filters.GzipFilter
public class GzipFilter
Compresses the response output if the browser accepts compression.
Browsers which support gzip compression will set the Accept-Encoding header. If GzipFilter detects the gzip compression, it will compress the output. GzipFilter will always set the "Vary: Accept-Encoding" header because the output depends on the request
Constructor Summary | |
---|---|
GzipFilter()
|
Method Summary | |
---|---|
void |
addAllowContentType(java.lang.String type)
Adds an allowed content type. |
void |
addDenyContentType(java.lang.String type)
Adds a deny content type. |
protected void |
addVaryHeader(HttpServletResponse response)
|
protected int |
allowGzip(HttpServletRequest req,
HttpServletResponse res)
Returns true if the GZip is allowed. |
void |
destroy()
Any cleanup for the filter. |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain nextFilter)
Creates a wrapper to compress the output. |
void |
init(FilterConfig config)
Initialize the filter. |
void |
setEmbedErrorInOutput(boolean embedError)
Set true if errors should be embedded in the output. |
void |
setNoCache(boolean noCache)
Set true if the output should not be cached. |
void |
setUseVary(boolean useVary)
Set true if the vary support should be enabled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GzipFilter()
Method Detail |
---|
public void setUseVary(boolean useVary)
public void setNoCache(boolean noCache)
public void setEmbedErrorInOutput(boolean embedError)
public void addAllowContentType(java.lang.String type)
public void addDenyContentType(java.lang.String type)
public void init(FilterConfig config) throws ServletException
Filter
init
in interface Filter
ServletException
public void doFilter(ServletRequest request, ServletResponse response, FilterChain nextFilter) throws ServletException, java.io.IOException
doFilter
in interface Filter
request
- the servlet requestresponse
- the servlet responsenextFilter
- the next filter in the chain
ServletException
java.io.IOException
protected void addVaryHeader(HttpServletResponse response)
protected int allowGzip(HttpServletRequest req, HttpServletResponse res)
public void destroy()
destroy
in interface Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |