Big picture like this?
I heard that whitenoise is great at several places.
But somehow I don't get the big picture.
Could you please make this more newcomer friendly by adding how a http-request gets handled step by step in a default installation?
If I understood it correctly it works like this (if you use gunicorn to run the django application):
First request:
- browser sends http request to https://example.com/static/foo.css
- The proxy at https://example.com does not know the file foo.css yet, it forwards the request to a gunicorn process.
- The WhiteNoiseMiddleware processes the requests, sends the foo.css to the proxy and sets http-headers telling the proxy to cache the file
- the proxy forwards the response to the browser.
A second request (coming from a second browser or not):
- browser sends http request to https://example.com/static/foo.css
- The proxy at https://example.com does know the file foo.css, and sends the cached version to the browser. The gunicorn application is not touched.
It would be nice to have these step at the top of the docs to make it easier to understand.
Yes, that's exactly how it works. I agree an overview like this would be a nice to thing to have in the docs. If I ever get time I'll add it!
Some concrete examples might be useful but I think it makes sense that the current description focuses on setting http headers mainly. Also, I guess you'd rephrase this a bit anyway, but I'd just note that using gunicorn and a caching proxy might be common but neither of those are required.
@evansd Is there anything we can do to help you, to get a step-by-step introduction like above?