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
COMPRESS_OFFLINE setting clarification #680
Comments
The Feel free to submit a PR with specific documentation tweaks once you have a good idea of the clarifications you seek - it's not clear to me what you'd want the docs to say at this point (probably because I'm fairly familiar with the way compressor works already). |
Also worth checking out http://django-compressor.readthedocs.org/en/latest/behind-the-scenes/ |
Oh, I see. That makes more sense. What got me confused was the ALSO. If you have the flag set, does the compression still happens at request time? I assume it doesn't from your response. Then when using COMPRESS_OFFLINE it is mandatory to run If I understood it now, this could better describe it (although there is room for improvement):
|
It does not. If
Yes, it should be done at each deploy. I'll review your documentation suggestion if you make a PR with it :) - I'd probably remove the note about Heroku, there are a lot of users struggling with Heroku, and I don't have an account myself to test with (or time to do it) so I don't want to promise it works. |
Compressor's online mode doesn't work on Heroku because Whitenoise doesn't by default pick up changes to the static folder after the app has been loaded. That can be changed by changing the WHITENOISE_AUTOREFRESH setting to true, but it's really only meant for development mode. To use Compressor in production you should set Might also be applicable to issue #486 |
Hey there!
I spent awhile struggling to get django-compress working together with whitenoise on Dokku (you know, almost Heroku).
I stared for some time at this ticket #486 (comment) and tried several things, all without success.
Even disabled whitenoise's caching, and still no luck.
I had come across the COMPRESS_OFFLINE setting, but had ignored it since
compress --force
created the needed file, and it states that when it is set, the compressing will be ALSO done offline together with request/response loop.I had thought: "If it won't disable online compression and the --force flag works, why bother?"
Turns out I need to set this to
COMPRESS_OFFLINE = True
to finally get it working.Before setting this flag, the file name set on my html didn't match the one on the file system.
So, I just suggest the docs reflect the need to set that flag if working offline. At least I had to.
The text was updated successfully, but these errors were encountered: