Adding gzip compression to a Rancher HAProxy Load Balancer
Say you want to gzip application/json coming from your application you can put a Rancher Load Balancer (HAProxy) in front and add the following config to the
compression algo gzip compression type application/json
This will then gzip all responses with
Content-Type: application/json if the client supports compression.
A simple benchmark suggests that doing it at the LB instead of within the application is more performant than, say, using the compression middleware in a node.js express application
For a more complete set of MIME types which can be compressed, use this: