-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Django] Ease disabling gzip support #207
Comments
Hi :-) In #148 I found that Brotli took 95%+ of the total time to compress, so disabling gzip probably wouldn't help reduce the duration by much. Instead concurrency is likely the best way forwards - I keep meaning to find time to dust off the WIP I have locally. |
Hi! Good analysis at #148. I think we can have both at the same time: Getting wanted things faster (Brotli) and unwanted things (gzip for me) not be done at all. |
…r-config-with-django Extract method .create_compressor x2 (#207)
With #208 merged and with WhiteNoise 4.1.2 around the above code can now be simplified to: # Copyright (c) 2018 Sebastian Pipping
# License under the MIT license
from whitenoise.compress import Compressor
from whitenoise.storage import CompressedManifestStaticFilesStorage
class WhiteNoiseWithoutGzipStorage(CompressedManifestStaticFilesStorage):
def create_compressor(self, **kwargs):
kwargs['use_gzip'] = False
return Compressor(**kwargs) Closing, "bug" fixed in my eyes. Thanks again! |
Hi!
I'm very happy I ran into WhiteNoise, happy user, thanks for sharing it as software libre.
I started using brotli (with
brotli_static on;
) at some point and noticed that compressing all the files with both gzip and brotli takes a few seconds. So I played with getting rid of gzip compression like this:(and then
STATICFILES_STORAGE = 'foo.bar.storage.WhiteNoiseWithoutGzipStorage'
in settings to activate, for completeness)As you can see, to make that work, I currently need to duplicate 100% of
CompressedManifestStaticFilesStorage.compress_files
, which is not ideal.So I wonder about how to best ease that case. One way would be to extract a new public-API method
create_compressor
similar to the one above, except withoutuse_gzip=False
. Would you except a pull request in that direction? Would you want to do it yourself? Other ideas?Thanks and best, Sebastian
The text was updated successfully, but these errors were encountered: