On 11/03/2015 14:44, Victor Rodriguez wrote:
> Thanks Geoff!  The thing is that I'd rather not have to add a servlet
> filter.
> 
> Chris, I'm on Tomcat 7.0.53.

Finally. We have some version information.

The bad news is that the Default servlet gzip feature being discussed is
only available in 8.0.x.

>  The files don't have .gz extensions; they end
> in .json and .terrain.  If I have gzip="true" will tomcat add
> "Content-encoding: gzip" to all requests or only for files that end in
> .gz?

For those on Tomcat 8...

If the client requests foo.bar and declares that they accept gzip (and
gzip is enabled on the Default servlet), Tomcat looks for foo.bar.gz
and, if it exists, sets "Content-encoding: gzip" and returns the content
of foo.bar.gz.

In the unlikely event that the client doesn't support gzip or the more
likely event that a .gz version isn't available, Tomcat returns the
resource as originally requested. i.e. the idea is that both foo.bar and
foo.bar.gz exist in parallel.

> Having "Content-encoding: gzip" is the only way the browsers will
> gunzip on the fly.

Not strictly true although it requires a browser that actually follows
the HTTP specs for transfer-encoding and the last time I checked most
didn't.

> I was able to accomplish what I need with Apache with
> the following configuration, but my preference is to use Tomcat.

With Tomcat 7, a filter (which I know you'd rather not use - I mention
for others with the same question reading the archives) is likely the
simplest pure Tomcat option.

Another option would be to upgrade to 8.0.x.

Mark

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

Reply via email to