4

In a Java web application running in an Apache Tomcat servlet container with an Apache httpd in front of it:

  • is it better to use enable GZIP compression on Tomcat or on httpd level?
  • is it better to have SSL enabled in Tomcat or on httpd?

Application is used in a more or less reliable network (better than public internet, but a little bit worse than LAN) in terms of dropped packets, ping latency etc. The application makes heavy use of large dHTML, AJAX, static and dynamic content. Long user sessions (hours).

2 Answers 2

6

Keep both of it at the edge i.e. the server that is connected to the client browser. Compressing the stream is simple enough that it should not tax Apache much and SSL should be used to secure the traffic between Apache and browser.

[browser]---ssl+gzip---[apache]---ajp---[tomcat]
           (internet)           (local)

You don't want to put the SSL at tomcat while proxying directly over Apache because it will waste needless traffic for the SSL negotiation. Ajp is also somewhat compressed (in a manner of speaking).

0

I would enable gzip in Apache. This allows you to compress all content served from there in one go, should you ever decide to add another application or serve some static content as well.

I am not certain about the SSL part, but I would think that should go in Apache as well, since once encrypted compression and any caching you may wish to use would not function.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .