1 2 3 4 5 6 7 8 | < init-param > < param-name >com.sun.jersey.spi.container.ContainerRequestFilters</ param-name > < param-value >com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</ param-value > </ init-param > < init-param > < param-name >com.sun.jersey.spi.container.ContainerResponseFilters</ param-name > < param-value >com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</ param-value > </ init-param > |
You can prove that this works by querying your resource with Firebug, or Developer Tools (depending on browser). You can also confirm that it is working by performing a query like:
curl -HAccept-Encoding:gzip -HAccept:application/json http://localhost:8080/content-coding-gzip/webresources/widget > json.gz
gzip -v -l json.gz
method crc date time compressed uncompressed ratio uncompressed_name defla 3a79ae18 Jan 20 15:25 1370 3389 60.3% json
The only issue that I have with the currently implemented version is that it does not use configurable compression level.
0 comments :
Post a Comment