Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big picture like this? #270

Open
guettli opened this issue Dec 17, 2020 · 3 comments
Open

Big picture like this? #270

guettli opened this issue Dec 17, 2020 · 3 comments

Comments

@guettli
Copy link

guettli commented Dec 17, 2020

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:

  1. browser sends http request to https://example.com/static/foo.css
  2. The proxy at https://example.com does not know the file foo.css yet, it forwards the request to a gunicorn process.
  3. The WhiteNoiseMiddleware processes the requests, sends the foo.css to the proxy and sets http-headers telling the proxy to cache the file
  4. the proxy forwards the response to the browser.

A second request (coming from a second browser or not):

  1. browser sends http request to https://example.com/static/foo.css
  2. 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.

@evansd
Copy link
Owner

evansd commented Dec 18, 2020

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!

@balazs-endresz
Copy link

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.

@guettli
Copy link
Author

guettli commented Jul 21, 2021

@evansd Is there anything we can do to help you, to get a step-by-step introduction like above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants