Current time: 10-23-2019, 08:49 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
flushing response performance gains?
08-25-2010, 04:04 AM (This post was last modified: 08-25-2010 04:29 AM by sajal.)
Post: #1
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

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?

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
08-25-2010, 05:03 AM
Post: #2
RE: flushing response performance gains?
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
08-25-2010, 08:04 AM
Post: #3
RE: flushing response performance gains?
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)