WebPagetest Forums

Full Version: flushing response performance gains?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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

Code:
<html>
  <head>
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <script type="text/javascript" src="javascript.js"></script>

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...
to be more specific.... will it work if i have the
Code:
</body>
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.
Reference URL's