[Fixed]-Django, Nginx & Varnish gzip params to be activated

1๐Ÿ‘

โœ…

My approach to where gzip compression should be done is this:

Enable gzip on a web server that is behind Varnish.

In your case, you can keep it in Django.

Do not alter default Varnish gzip parameters. (let it handle gzip using default behaviour)

Why?

  • Varnish can store gzipped object in its cache (good, saves storage).
  • No CPU time will be spent for compression while serving a cached object (most of the clients will ask for compressed object and Varnish can just serve it directly)

So you would save both CPU and RAM by doing compression on appropriate level.

Leave a comment