Django whitenoise drawback
Asked Answered
P

3

27

There are many article describing the pros of using whitenoise instead of other configuration for serving static files. But the information about it's cons is kind of hard to find

Is there any cons or drawbacks of using whitenoise for serving static files?

If the question is to broad, I'm now using NGINX for serving my static files (I also use it and gunicorn for serving my Django Application) and I found its also quite easy to configure it

Pneumonoultramicroscopicsilicovolcanoconiosis answered 13/5, 2018 at 16:26 Comment(1)
There's some documentation here that says it's not so bad to use whitenoise considering there are a lot of configuration that should be done on nginx side which is usually not done for smaller projects: whitenoise.readthedocs.io/en/stable/…Coexecutor
L
39

The downside of WhiteNoise is that if you use it without a CDN like Cloudfront or Cloudflare it will definitely not perform as well as nginx. WhiteNoise is best either when used with a CDN (as most production sites ought to be doing) or for low-traffic sites where ease of configuration trumps performance.

If you already have nginx correctly configured and don't plan on using a CDN for some reason then you're probably better off just sticking with nginx.

Landri answered 15/5, 2018 at 8:22 Comment(0)
S
1

So as long as you're using a (dependable) CDN, you should be fine. If not, this is a VERY BAD IDEA. Let me create a sceanrio! Suppose you use Whitenoise without CDN, and you upload a large file of like 10mb or so on your server which is meant to be downloaded by the end-users. If anyone of your end-users has a poor(mobile) connection and starts to download that file. YOUR SERVER WILL STOP SERVING ALL OTHER TRAFFIC. WHY SO?

The web application server will be squashed serving that poor connection and no other traffic will be entertained untill that file is served. Application Server Processes are a precious resource. They should be utilised very carefully.

Shardashare answered 1/12, 2023 at 6:59 Comment(0)
A
0

Nginx supports automatica SSL renewal via Certbot, this is a big advantage to me.

Ancient answered 8/11, 2021 at 10:11 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.