If you are concerned about RAM usage, there are some trade-offs available (slightly lower compression ratio), for more effective resource usage.
As used by HAProxy for gzip filter, from the Will Tarreau, creator of HAProxy: https://github.com/wtarreau/libslz