-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Rainer,

On 3/9/15 7:01 PM, Rainer Jung wrote:
> Am 09.03.2015 um 23:11 schrieb Christopher Schultz:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> Igor,
>> 
>> On 3/9/15 6:01 PM, Igor Cicimov wrote:
>>> On 10/03/2015 6:14 AM, "Victor Rodriguez"
>>> <victropo...@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 something else that can add this header for you?
>> 
>> Ironically, getting this to work as requested in Apache httpd is
>> a complete nightmare. The Tomcat solution basically works
>> *exactly* as a user would want it to work.
> 
> Agreed, that the feature in the default servlet is much much easier
> to use than configure pre-compressed content in httpd. But
> nightmare might be a bit to strong. It is tricky. See for example:
> 
> http://mail-archives.apache.org/mod_mbox/httpd-users/201110.mbox/%3c4e8e51c0.4050...@kippdata.de%3E

Would
> 
you be up for the creation of mod_already_gzipped? It could act
just like the DefaultServlet's behavior:

1. Did the client say it could Accept-Encoding: gzip?
2. Does the file [translated-path].gz exist?
3. Then send those bytes with Content-Encoding: gzip and
Content-Length: size(file.gz)

It seems like that should be a no-brainer in terms of functionality.

Using MultiViews and re-naming your files to bizarre filenames, etc.
is a big hack that I finally decided wasn't worth it.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU/vszAAoJEBzwKT+lPKRYEXIQAKLx1pbCojQ9kcAeCp/ChLOd
x0B9AB7vPJBnB7+BkQV9n+0ZDm8xSw1BqnIWkNFGlCm/5ysz1YTxi358o7ksIqXS
stJXzrnF03f9v2M8tkm5A0Tmb9zO5lPbfgcCnv2qjtYstVB4NyMtowo7sGtUGpVW
uYKRWiRBbjwK/np7esoi5waosPepMttPx1E6dVKqSOrru805qs8FzO+uEjlTfLOt
vClfbZm9bkpyNUiEaj1P/oc10vjzKMXAPL1aqu5RMJz8sxvZugT/nLIpUTFbBHLY
XJW+aaKzrV5mlb8OK3NvQTTFEZO+KhL1lqTrWVtiQUx9jIDed3fuzBhy8PggIIu7
IoD7nCL3sPASxm+Hf2cf2I64vEXZQg85sxZh8rEZTmruqqmGSx3EauDzReU7AVOW
C2PNRexath9p5Pv1d3gAMjapybx4xPNtbaA2ThSENurzsba2c4jdJXD7lMWmGaIf
lmBbmCaAIn2C0UWkPBAQKOSAKmE6jmpCkqwmhP7WhjALfOSUDVXJTRA7nZ0ZkMh1
UuypvPvqDDcyLKKnrSaQiyYQ09r92Ru393YqVtaaQRkNX3hKwciLYfd1saJnyo9b
x7z6xIgvNf/tGOWye/QW68rn3ahpmArizYNeSz/FxWZxXuuFuwJoyGhErrOAADdR
z2OK5VlnKZWPTbWUOqlV
=4c4D
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to