Does mod_wsgi (daemon) sites hand off content to apache to serve to the client?

WSGI interface says ( python.org/dev/peps/pep-0333 ) that your WSGI application (Django in this case) is called, and must return the content Django called your view function. Your view function returned a rendered template. Django returned results of rendering the template.

And, on your behalf, it invoked the start_response callable Working backwards another step, Apache invoked mod_wsgi. Mod_wsgi (following the WSGI rules) created the environment and handed this to Django, along with a start_response callable that Django can use When Django called start_response mod_wsgi was obligated to collect that response and do something with it. It hands it to Apache to be fed down to the browser Note that Django may be done in a pretty big hurry.

Apache, however, is stuck trickling the initial page down to the browser. Then, the browser starts asking for . JS libraries, .

CSS files, and all those images. Ideally Apache handles all the rest of these follow-on requests You might be asking "does mod_wsgi buffer for me? " The answer varies with version.

Pre 2.0 mod_wsgi could accumulate a buffer for you. Mod_wsgi 2.0 and up doesn't buffer, it assumes that the application is capable of buffering, or has included middleware for buffering http://code.google.com/p/modwsgi/wiki/ChangesInVersion0200 Generally, your Django template is rendered in one buffer and handed to mod_wsgi in one piece, ready for Apache to apply output filters and trickle it down to a browser.

WSGI interface says (python.org/dev/peps/pep-0333/) that your WSGI application (Django in this case) is called, and must return the content. Django called your view function. Your view function returned a rendered template.

Django returned results of rendering the template. And, on your behalf, it invoked the start_response callable. Working backwards another step, Apache invoked mod_wsgi.

Mod_wsgi (following the WSGI rules) created the environment and handed this to Django, along with astart_response callable that Django can use. When Django called start_response, mod_wsgi was obligated to collect that response and do something with it. It hands it to Apache to be fed down to the browser.

Note that Django may be done in a pretty big hurry. Apache, however, is stuck trickling the initial page down to the browser. Then, the browser starts asking for .

JS libraries, . CSS files, and all those images. Ideally Apache handles all the rest of these follow-on requests.

You might be asking "does mod_wsgi buffer for me? " The answer varies with version. Pre 2.0 mod_wsgi could accumulate a buffer for you.

Mod_wsgi 2.0 and up doesn't buffer, it assumes that the application is capable of buffering, or has included middleware for buffering. http://code.google.com/p/modwsgi/wiki/ChangesInVersion0200 Generally, your Django template is rendered in one buffer and handed to mod_wsgi in one piece, ready for Apache to apply output filters and trickle it down to a browser.

Yup. It can't buffer and be WSGI compliant: "WSGI servers, gateways, and middleware must not delay the transmission of any block; they must either fully transmit the block to the client, or guarantee that they will continue transmission even while the application is producing its next block. " – Jason Baker Jun 24 '09 at 12:33.

FWIW, in mod_wsgi 1. X, allowing Apache to perform output buffering was off by default. This is because WSGI specification effectively prohibits output buffering by the underlying web server.

This is because WSGI specification requires that data be flushed back to the browser after each string returned from the iterable/generator. In other words, enabling output buffering was optional and more an experiment than anything else. It was removed because WSGI prohibited it and because it actually complicated the mod_wsgi code when it was necessary to implement some work arounds for incorrect behaviour in certain Apache versions.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions