Allow folks to optionally enable GZIP/Deflate compression for actionhero/servers/web. This can now be toggled on/off with api.config.servers.web.compress
. While this option exists, it is still best-practice to have an upstream process handle compression rather than node, like Nginx or a load balancer.
When enabled, if the client indicates they can handle compressed responses (via the Content-Encoding
header, we support gzip
and deflate
), Actionhero will compress results before sending the data over http. This decrease the network payload at the expense of both server and client CPU time.
By @evantahler via #689