-
Notifications
You must be signed in to change notification settings - Fork 145
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
Not serving compressed files #422
Comments
Is the |
Accept-Encoding is set to: Edited Accept-Encoding to just The |
Browsers only use Brotli compression over HTTPS, it may be that IIS follows this. Are you testing over HTTPS? |
Yes it is over HTTPS. I tested and pulled a css file from another site and it came in as |
I'm afraid I can't help you further here, unless you can provide a simple reproduction (I've never used IIS, maybe you can give e.g. Docker commands to run it, along with a sample project). But mostly I think you'll need to roll your sleeves up and debug each stage, maybe add print statements inside your app/whitenoise to see what headers are actually getting through, where Whitenoise is deciding not to send brotli, etc. |
Will do. |
I am using Cloudflare CDN and they only request gzip from origin. I turned off proxy and put in development mode to test and the request is still gzip. That surprised me, but this issue is resolved. |
Problem solved then! |
I am using Cloudflare CDN and they only request gzip from origin. I turned off proxy and put in development mode to test and the request is still gzip. That surprised me, but this issue is resolved. |
Python Version
3.10.7
Django Version
4.1
Package Version
6.2.0
Description
Using Django on IIS and whitenoise is serving the css and js fine in uncompressed format. I have the settings for middleware
'whitenoise.middleware.WhiteNoiseMiddleware',
and
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
setup as documented. I have run collectstatic and the files are collected, the gz and br variants are created and the manifest json is created.
When a static file is requested, whitenoise will return the plain/uncompressed js or css file. I can compress it using the cloudflare CDN, but I would like to understand why the brotli file is not sent from the origin. All built-in IIS compression is disabled. But if I enable it, I get the IIS compressed file (different file-size then the .br file on disk).
The text was updated successfully, but these errors were encountered: