0

I am working in WordPress. I have several sites set up the exact same way (as far as I can tell). Most behave as expected. However, a few of them are such that the browser (all types) does not show the progress of a first-time load or refresh until the page is fully loaded. It appears idle and then "BLINK", there it is -- fully loaded.

The performance is fine but it is unnerving to have nothing moving until the end. The header is very clean, no "onLoad" statements, etc., and I do not see any scripting in the PlugIns that would cause this to occur.

Not sure if "forcing" is the solution but I am out of ideas. I'll take anything at this point.

skaffman
  • 398,947
  • 96
  • 818
  • 769

1 Answers1

0

If you are using PHP, use flush(), if ASP.NET use Response.Flush(). They're not guaranteed to work though, it depends on the browsers if they will honor your flush request. Try to use jQuery and ajax instead, it can make your app look snappy.

I tried flush on PHP way back 2001, I noticed Mozilla honors flush request I put in long-running loop, there's no plethora of browsers then, unlike today. Not all browsers honor flush requests

UPDATE

I tried on Chrome, Firefox and Safari, they all honor the flush request. Just try on IE if it recognize flush too:

<table border="1">
   <th>Message</th>
   <% for(int i = 0; i < 1000; ++i) { %>
        <tr>
        <td>
        <%=i %> Hello<br>
        <% System.Threading.Thread.Sleep(500); %>
        <% Response.Flush(); %>
        </td>
        </tr>
    <% } %>
</table>
Community
  • 1
  • 1
Michael Buen
  • 38,643
  • 9
  • 94
  • 118
  • Thanks Michael, this is great news. However, we just stepped outside my knowledge area. These days I program primarily in HTML/CSS and can re-wire WordPress components all day. I am not at all certain how/where to implement your solution. I assume just inside the main container DIV. Sorry, it has been far too long since I did any "real" programming. Any pointers would be appreciated. – Scott Lowe Apr 28 '12 at 20:16