stackular
stackular

Reputation: 1471

Can Tomcat be configured for gzip per war file?

I have a Tomcat running with several .war files but I only want to enable gzip compression for some of them (all running on Spring). How can I specify gzip HTTP compression per war?

Upvotes: 0

Views: 466

Answers (1)

Augusto
Augusto

Reputation: 29927

You have a few options. The recommended one is to do this in the webserver that you have in front of your apps (if you don't have one you'll probably learn quite soon why you need one).

Another approach, but not as good as the one above, is to use a different Connector, which means that those apps will be listening on a different port.

And the last and worse approach is to add a filter that does the GZIP compression, as explained here.

Upvotes: 1

Related Questions