tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Cicimov <icici...@gmail.com>
Subject Re: [URGENT] Content-Encoding: gzip not set
Date Mon, 09 Mar 2015 22:01:09 GMT
On 10/03/2015 6:14 AM, "Victor Rodriguez" <victropolis@gmail.com> wrote:
>
> Greetings,
>
> I have some ALREADY gzipped files that I'm trying to serve up.
>
> I have the following in my web.xml.
>
> <mime-mapping>
>     <extension>json</extension>
>     <mime-type>application/gzip</mime-type>
> </mime-mapping>
>
>
> And, I have the following in my server.xml:
>
> <Context docBase="/path/to/already-gzipped-json"
path="/already-gzipped-json" />
>
>
> From the command line, I can curl the files and gunzip them just fine, so
> they are coming across gzipped:
>
> curl http://localhost:8082/already-gzipped-json/fie.json | gunzip -
>
> However, requests coming from a web browser aren't handled correctly and
> aren't legible in the browser, and I believe it's because
Content-Encoding:
> gzip is not in the response headers.
>
You mean Accept-Encoding, right? Is tomcat fronted by apache, nginx or
sometning else that can add this header for you? If not then maybe just
consider it as option if you can't solve it in tomcat although according to
the comments you got here from people that are really experts it should be
possible.

> curl -I http://localhost:8082/already-gzipped-json/fie.json
>
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Accept-Ranges: bytes
> Last-Modified: Mon, 09 Mar 2015 17:15:29 GMT
> Content-Type: application/gzip
> Content-Length: 17905
> Date: Mon, 09 Mar 2015 19:11:06 GMT
>
> How do I tell Tomcat to include the Content-Encoding: gzip response
> header?  Again, these area ALREADY zipped files.  I'm not interested in
> Tomcat doing the gziping on the fly.
>
> Thanks!
> --
> Sent from neither my iPhone nor my iPad.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message