djangoapachedeploymentgzipmod-deflate

mod_deflate vs Django GZipMiddleware, which one to use for deployment?


We're deploying Django apps with Apache 2.2 + mod_wsgi. Should we enable mod_deflate in Apache or use Django's GZipMiddleware? Which option performs better?


Solution

  • You should probably test to know for sure, but if I were to guess, mod_deflate would be better for requests that totally bypass Django completely (like zipped up static resources that should be deployed separately i.e. media).

    For things that are already generated by Django responses, it's probably a toss-up -- in either case it would be native code doing the zipping.