datamade / how-to

📚 Doing all sorts of things, the DataMade way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider using nginx in our Heroku django apps

fgregg opened this issue · comments

Background

Using straight gunicorn, which is the default heroku setup for django apps can lead to some problems when you have multiple slow connections (as would be common for mobile). Using nginx can address this. Additionally, if nginx is part of our our heroku stack, then we can get control of setting Cache-Controls for static assets.

That in turn would unlock using taking advantage of Django's ManifestStaticFilesStorage and letting browsers cache our static assets.

Proposal

Heroku has an officially supported buildpack for nginx. I'd like to spike an PR on one of our heroku-deployed django apps and see what's involved in switching over.

Deliverables

If the PR looks good, then I'll updated the django cookie cutter template.

Timeline

1 investment day.

We're currently using WhiteNoise for this: http://whitenoise.evans.io/en/stable/

@fgregg is going to verify that it's behaving as expected. If so, we'll close this.

looks like whitenoise is doing the right thing