Django-compressor: how to write to S3, read from CloudFront?

前端 未结 6 1287
失恋的感觉
失恋的感觉 2020-12-12 19:52

I want to serve my compressed CSS/JS from CloudFront (they live on S3), but am unable to work out how to do it via the compressor settings in settings.py, I have the followi

6条回答
  •  误落风尘
    2020-12-12 20:33

    Actually this seems also to be an issue in django-storages. When compressor compares the hashes of files on S3, django-storages doesn't unpack the content of the Gzip'ed files, but tries to compare different hashes. I've opened https://bitbucket.org/david/django-storages/pull-request/33/fix-gzip-support to fix that.

    FWIW, there is also https://bitbucket.org/david/django-storages/pull-request/32/s3boto-gzip-fix-and-associated-unit-tests which fixes another issue of actually saving files to S3 when having AWS_IS_GZIPPED set to True. What a yak that has been.

提交回复
热议问题