flushing response performance gains?

I play with Django web framework for most web stuff, and the default template system doesnt support flushing.

As in since its a MVC framework, all computations are done before it starts to parse the templates…

Say I have a page that takes 1 seconds to generate on the server. The browser is doing nothing during that 1 second.

If I can somehow flush this portion instantly



And the rest after all the computations, DB queries, etc are completed… does this mean that during that 1 second wait time, the stylesheet and javascript is already downloaded and will not block anymore once the rest has arrived?

I have some javascript and css which needs to be used on all pages…[hr]
to be more specific… will it work if i have the


after the flush?

Yes (assuming you send enough data - even whitespace - to satisfy the given browser and convince it to start parsing). That’s actually the whole point of flushing early, to let the browser get a head start on the external resources you can identify before your back-end starts a time consuming operation.

sajal, I also use the Django framework for most everything and I’ve been recently searching for a way to flush the head before the body of the document is ready in order to allow the browser to get started on external resources before the response is done.

If you figure out a way to make this happen I’d really appreciate the knowledge. I’ll be sure to pass it along to you if I figure it out as well.