|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.util.JiveCompressionFilter
public class JiveCompressionFilter
This filter can, based on HTTP headers compress data written to the response stream. When supported by the client browser, this can potentially greatly reduce the number of bytes written across the network and improve both perceived and actual response times.
This filter has a variety of configuration options available that can be set via jive properties.
Property name | default value | Description |
---|---|---|
jive.compressionFilter.enabled | enabled | Enable/disable the compression filter |
jive.compressionFilter.contentTypes | text/html,text/css,text/javascript,application/x-javascript | A comma separated list of lowercase content types that this filter will compress. If not provided this filter will only filter content that has a text/* content type. |
jive.compressionFilter.excludeUserAgentPatterns | N/A | Set to a regular expression of any user-agent string that should not be served compressed content. This filter is hardcoded to not serve compressed content to IE < 7 as any version of IE earlier then 7 has known issues with gzip compression |
jive.compressionFilter.compressionThreshold | 1024 | The smallest response that will be compressed in bytes |
This filter supports the following compression algorithms when compressing data to the response, as specified in the "Accept-Encoding" HTTP request header:
Note that if this filter decides that it should try to compress the response, it will close the response whether or not it ends up compressing the response.
Field Summary | |
---|---|
static java.lang.String |
COMPRESSED_KEY
A request attribute is set under this key with a non-null value if this filter has applied compression to the response. |
static java.lang.String |
CONTENT_TYPES_PROP
|
static java.lang.String |
ENABLED_PROP
|
static java.lang.String |
EXCLUDE_UA_PROP
|
static java.lang.String |
STATS_ENABLED_PROP
|
static int |
THRESHOLD_DEFAULT
|
static java.lang.String |
THRESHOLD_PROP
|
Constructor Summary | |
---|---|
JiveCompressionFilter()
|
Method Summary | |
---|---|
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
static JiveCompressionFilterStats |
getStats()
|
void |
init(javax.servlet.FilterConfig config)
|
void |
jivePropertyAdded(JivePropertyEvent event)
Fired when a jive property is added |
void |
jivePropertyModified(JivePropertyEvent event)
Fired when a jive property is modified |
void |
jivePropertyRemoved(JivePropertyEvent event)
Fired when a jive property is removed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ENABLED_PROP
public static final java.lang.String STATS_ENABLED_PROP
public static final java.lang.String CONTENT_TYPES_PROP
public static final java.lang.String EXCLUDE_UA_PROP
public static final java.lang.String THRESHOLD_PROP
public static final int THRESHOLD_DEFAULT
public static final java.lang.String COMPRESSED_KEY
Constructor Detail |
---|
public JiveCompressionFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter
public static JiveCompressionFilterStats getStats()
public void jivePropertyAdded(JivePropertyEvent event)
JivePropertyListener
jivePropertyAdded
in interface JivePropertyListener
event
- event firedpublic void jivePropertyRemoved(JivePropertyEvent event)
JivePropertyListener
jivePropertyRemoved
in interface JivePropertyListener
event
- event firedpublic void jivePropertyModified(JivePropertyEvent event)
JivePropertyListener
jivePropertyModified
in interface JivePropertyListener
event
- event fired
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |