Comp-490-SeniorProject / site

MIT License
0 stars 1 forks source link

Set up whitenoise to serve static files #6

Closed MarkKoz closed 2 years ago

MarkKoz commented 3 years ago

I think we can simplify deployments and avoid configuring nginx if we use whitenoise to serve static files. The idea is that all the content will be behind a CDN. Therefore, most of the time it'll be cached, and it won't matter that Python is serving the static files.

Setup instructions are here. It talks about CloudFront as a CDN, but it's probably simpler to use Cloudflare. As I understand, Cloudflare is a DNS-based CDN, so we don't need to reroute our static URLs to the CDN. Also, I already have a domain on Cloudflare, so that makes it more convenient.

Which CDN to use and if we want to use whitenoise at all is up to discussion. I'm personally not too familiar with nginx though.