Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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).

share|improve this question

2 Answers 2

up vote 5 down vote accepted

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).

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.