As per this answer to Can I gzip JavaScript and CSS files in Django?:
Your CSS and JS should not be going through Django on your production system. You need to configure Apache (or Nginx, or whatever) to serve these, and when you do so you'll be able to set up gzip compression there, rather than in Django.
The answers to that question don't explain the reason for this requirement/advice. Is it just a good practice for speed to have static content (images/CSS/JS) served from a different server? Or is there more to it?
Apache and Nginx are faster than Django (because they do much less and much simpler things). So serving CSS and JS with Django is a waste of resources.
Although "should" is too strong here, IMO. "Should, if you have high traffic", rather.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With