Is it generally better to compress content on the proxy server or the app server?

If you are doing Layer 7 load balancing (HTTP) then there is no real benefit in the app server compressing the content because the proxy will uncompress the content sending it to the client. This happens because the LB might support different version/option than what the client is requesting.

Example LB speaks HTTP/1.1 to app server but the client speaks HTTP/1.0. Second example LB supports compression therefore app server's response is compressed but the client doesn't support compression.

You should disable compression on the app servers and let the LB handle compression. You'll save the LB a couple of CPU cycles of uncompressing and recompressing the content.

Disclaimer. I have used other load balancers but not a F5.


The question really boils down to where you want the added overhead to handle the compression logic to run. If your app servers are beefy put it there, otherwise the F5 should be able to handle it. Regardless, this is something you will have to evaluate based on how much will get compressed and how much additional load that places on your systems.