<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Don&#8217;t Forget to Flush</title>
	<atom:link href="http://www.eggplant.ws/blog/php/dont-forget-to-flush/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/</link>
	<description>Ramblings of a web developer</description>
	<pubDate>Mon, 06 Feb 2012 23:55:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michael Caplan</title>
		<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/comment-page-1/#comment-251</link>
		<dc:creator>Michael Caplan</dc:creator>
		<pubDate>Wed, 12 Oct 2011 13:49:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.eggplant.ws/blog/?p=62#comment-251</guid>
		<description>On load event handlers will only be processed after the complete page has been loaded.  jQuery's .ready() (http://api.jquery.com/ready/) method is probably a better choice if you are just interacting with DOM nodes.</description>
		<content:encoded><![CDATA[<p>On load event handlers will only be processed after the complete page has been loaded.  jQuery&#8217;s .ready() (http://api.jquery.com/ready/) method is probably a better choice if you are just interacting with DOM nodes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OnLine</title>
		<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/comment-page-1/#comment-250</link>
		<dc:creator>OnLine</dc:creator>
		<pubDate>Wed, 12 Oct 2011 10:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.eggplant.ws/blog/?p=62#comment-250</guid>
		<description>Hi
For example, if in the HEAD section i have a javascript with an window.onload instruction that selects some html elements from body, then i call flush() before the BODY.
This will send the HEAD code to browser, but if the BODY isn't added in that moment, doesn't it affect the JavaScropt code. 
Or, the window.onload will know and wait till the whole html page is loaded?</description>
		<content:encoded><![CDATA[<p>Hi<br />
For example, if in the HEAD section i have a javascript with an window.onload instruction that selects some html elements from body, then i call flush() before the BODY.<br />
This will send the HEAD code to browser, but if the BODY isn&#8217;t added in that moment, doesn&#8217;t it affect the JavaScropt code.<br />
Or, the window.onload will know and wait till the whole html page is loaded?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Caplan&#8217;s Blog: Don&#8217;t Forget to Flush : Dragonfly Networks</title>
		<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/comment-page-1/#comment-189</link>
		<dc:creator>Michael Caplan&#8217;s Blog: Don&#8217;t Forget to Flush : Dragonfly Networks</dc:creator>
		<pubDate>Fri, 09 Jan 2009 10:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.eggplant.ws/blog/?p=62#comment-189</guid>
		<description>[...] this recent post to his blog Michael Caplan looks at a feature of PHP that&#8217;s sometimes forgotten when pushing [...]</description>
		<content:encoded><![CDATA[<p>[...] this recent post to his blog Michael Caplan looks at a feature of PHP that&#8217;s sometimes forgotten when pushing [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael</title>
		<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/comment-page-1/#comment-188</link>
		<dc:creator>Mikael</dc:creator>
		<pubDate>Wed, 07 Jan 2009 11:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.eggplant.ws/blog/?p=62#comment-188</guid>
		<description>Whoops, missed the last paragraph... sorry !</description>
		<content:encoded><![CDATA[<p>Whoops, missed the last paragraph&#8230; sorry !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael</title>
		<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/comment-page-1/#comment-187</link>
		<dc:creator>Mikael</dc:creator>
		<pubDate>Wed, 07 Jan 2009 11:52:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.eggplant.ws/blog/?p=62#comment-187</guid>
		<description>I love the idea, but that is probably not gonna work in most MVC frameworks that implement the 'two-step' view way of rendering views.

As an example with ZF, as Loïc mentionned: if you use Zend_Dojo or Zendx_jQuery in conjunction with Zend_Layout, you don't build the HEAD content in one single spot in your code. It is done in several places, and this makes it hard to use a flush.

Example:
- Take a random, database-heavy page that is included in a default layout (= template). This is where most of the computing time is spent. That page then decides it needs some obscure plugin js file. That page is rendered. So far you can't send anything to the client.
- Then the layout decides that it needs a general use JS library. The layout is rendered and it then includes (wraps) the previously rendered page.
All work is done, the full response (head + body) are computed and can be sent back to the client. Nowhere in this scenario could you do a flush.

I'd love to hear a solution to this (or maybe I'm plain wrong ?), because this sounds like it could really speed up JS heavy webpages.</description>
		<content:encoded><![CDATA[<p>I love the idea, but that is probably not gonna work in most MVC frameworks that implement the &#8216;two-step&#8217; view way of rendering views.</p>
<p>As an example with ZF, as Loïc mentionned: if you use Zend_Dojo or Zendx_jQuery in conjunction with Zend_Layout, you don&#8217;t build the HEAD content in one single spot in your code. It is done in several places, and this makes it hard to use a flush.</p>
<p>Example:<br />
- Take a random, database-heavy page that is included in a default layout (= template). This is where most of the computing time is spent. That page then decides it needs some obscure plugin js file. That page is rendered. So far you can&#8217;t send anything to the client.<br />
- Then the layout decides that it needs a general use JS library. The layout is rendered and it then includes (wraps) the previously rendered page.<br />
All work is done, the full response (head + body) are computed and can be sent back to the client. Nowhere in this scenario could you do a flush.</p>
<p>I&#8217;d love to hear a solution to this (or maybe I&#8217;m plain wrong ?), because this sounds like it could really speed up JS heavy webpages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loïc Hoguin</title>
		<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/comment-page-1/#comment-185</link>
		<dc:creator>Loïc Hoguin</dc:creator>
		<pubDate>Mon, 05 Jan 2009 10:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.eggplant.ws/blog/?p=62#comment-185</guid>
		<description>About nested templates, I'm not sure about ZF but you could probably have a header template that you would create and render as soon as you receive the request, and then have a body template that would contain the rest. The HTML header usually doesn't have too much specific code so it should work out pretty well for most projects.</description>
		<content:encoded><![CDATA[<p>About nested templates, I&#8217;m not sure about ZF but you could probably have a header template that you would create and render as soon as you receive the request, and then have a body template that would contain the rest. The HTML header usually doesn&#8217;t have too much specific code so it should work out pretty well for most projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ellisgl</title>
		<link>http://www.eggplant.ws/blog/php/dont-forget-to-flush/comment-page-1/#comment-184</link>
		<dc:creator>ellisgl</dc:creator>
		<pubDate>Mon, 05 Jan 2009 02:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.eggplant.ws/blog/?p=62#comment-184</guid>
		<description>Beware of using flush by itself. Some times you have to make sure that you have enough data output before the browser response. Here's something I've been using with my COMET stuff.

function RealFlush($Out = "", $Padding = 4096)
 {
  echo str_pad($Out, $Padding);
  @ob_flush();
  @flush();
 }</description>
		<content:encoded><![CDATA[<p>Beware of using flush by itself. Some times you have to make sure that you have enough data output before the browser response. Here&#8217;s something I&#8217;ve been using with my COMET stuff.</p>
<p>function RealFlush($Out = &#8220;&#8221;, $Padding = 4096)<br />
 {<br />
  echo str_pad($Out, $Padding);<br />
  @ob_flush();<br />
  @flush();<br />
 }</p>
]]></content:encoded>
	</item>
</channel>
</rss>

