3

I have django.middleware.gzip.GZipMiddleware enabled. It serves template gzipping.

django-compressor is set to COMPRESS_STORAGE = 'compressor.storage.GzipCompressorFileStorage'

Locally everything is ok. static css and js assets are compressed and split into one file and gzipped, html response is gzipped page, but deployed on heroku, it does not work. django-compressor does not even create .gz versions in its folder.

For today, I can get rid of compressor and make pre-build gzipping of css and js. But it seems overall strange. At least the requirements for middleware are satisfied.

UPD

Ok, I localized part of the problem. For some reason my proxy was not configured to process compressed content. So GZipMiddleware works as it should. django-compressor remains to be tested.

UPD2

After all everything works. The issue with compressor was (after deploying to amazon s3) as far as I can understand the absense of AWS_IS_GZIPPED = True in settings.py

Nick Revin
  • 186
  • 6

1 Answers1

0

Take a look here: https://mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/ - specifically:

The Cedar 'herokuapp.com' HTTP stack directly connects requests to the backend for flexibility (think WebSockets and the like), but doesn’t provide gzip or buffering of requests. (In fact, the Heroku Django docs mention using gunicorn+gevent, but don’t actually configure gevent in the relevant examples.)

elithrar
  • 23,364
  • 10
  • 85
  • 104
  • 2
    Following https://devcenter.heroku.com/articles/http-routing#gzipped-responses, "any compression of responses must be done within your application". That's what I'm trying to do... – Nick Revin May 29 '13 at 08:47