java - Playframework 2.3.4 gzip not working -
java - Playframework 2.3.4 gzip not working -
i have enabled gzip encoding play framework 2.3.4, according documentation https://www.playframework.com/documentation/2.3.x/gzipencoding:
i have added dependency in build.sbt:
librarydependencies += filters
then have created global object:
import play.globalsettings; import play.api.mvc.essentialfilter; import play.filters.gzip.gzipfilter; public class global extends globalsettings { public <t extends essentialfilter> class<t>[] filters() { homecoming new class[]{gzipfilter.class}; } }
i made test calling:
curl -i -h 'accept-encoding: gzip' http://localhost:9000/my-api
the result was:
http/1.1 200 ok content-length: 3202 content-type: application/json; charset=utf-8
but expecting find next header in answer:
content-encoding: gzip
somebody else had same problem ? did miss in configuration?
your problem -i option; returning headers, there no content zip.
if utilize -v, see "content-encoding: gzip" in response.
curl -v -h 'accept-encoding: gzip' http://localhost:9000/my-api
java gzip playframework-2.3
Comments
Post a Comment