Use PHP Flush To Improve Site Loading Speed
Written by Pradeep Kumar in Tips and tricks - Print This Post
Ever since Google started to consider site speed for search rankings, webmasters and bloggers started to improve site loading speed.
You can check the best tools to improve site loading speed, FYI, you can also use Google Analytics to check site speed.
Why To Add PHP Flush Function?
PHP function flush() allows you to send your partially ready HTML response to the browser so that it will start to fetch the components while your backend is still busy with the rest of the HTML page. You can experience this effect when you have busy backends or light frontends.

Though the speed increase will actually depend on the server-side processing, page weight, and size of your CSS files. It is a simple optimization, and nothing wrong in doing it.
Where To Add PHP Flush Function?
To allow the browser to fetch CSS and JavaScript files in parallel, without disturbing the backend, it is recommened to use the function <?php flush(); ?> in between </head> and <body> tags. If you are using WordPress, then you have to edit header.php file probably.
</head>
<?php flush(); ?>
<body>
This is a simple tweak, and do tell us if this works for you.
Want to share or tweet this post? Please use our short URL : http://hbb.me/w4











Implementing it now. Let's see if any noticeable improvements take place.
Nice one
Will deinetly give a try
Well this is a nice tip buddy
, guess we all 've to give our best to make our blogs load faster
Happy Fast Blogging
lol
It's so simple… Let me try it. I hope it really work on my site too.
But have to add in which file of wordpress? Stylesheet or other. Please help as I am newbie.
Buddy, you need to paste this on header.php file.
Ok. Thank You I will try it out.
will try this..
going to try this….thanks for sharing Pradeep
anybody tried that ?
Many sites! QuickOnlineTips and HBB for example.
Sounds too good and simple to be true. Will definitely give it a try to see if it works. Thanx for sharing this.
Will give it a try…
How will I add it on thesis theme ?
there is a Head.php file in Thesis also under lib>>classes folders you can add it to that file.. I have not tried it..
In header.php file mate.
Remember I said I had doubts about adding it to my theme but I just did and everything still works fine on my hand. Do please be kind enough as to check if it loads fine on your end. Thanks man
How do i implement this on blogger.Just state it in simple way,while i try to work on this
Sorry mate, Blogger blogs will not be able to implement this.
one of teh simplest thing which works indeed
implementing it right now..will check it out how it works..
But Which file should I edit to add this code, is it style.css(the stylesheet) or the Index page template???
Shawn you should add this to header.php file.
Nice tip buddy… but will it make any prob with my existing caching plugin ? (hypercache)
Hi Jojo,
I didn't face any problem with my caching plugin. I use W3 Total Cache. My clients, they use Super Cache, didn't face any either.
This is easy enough. But I wonder if it really improves on the speed?
Jasmine, this simple tweak is recommended by Yahoo! for better performance.
http://developer.yahoo.com/performance/rules.html#flush
Nice tip, thanks for sharing. I just added in my website and I will report back with results.
Hey Pradeep, are you still using PHP Flush? I read this: http://goo.gl/1wZgh on stackoverflow. How was your experience with it?
Hi Renji, thanks for sharing that. I'll take a look.
hi,,,,its not working in blogger,,,when i save it,,,it says that template is not well build,,,so it fails
do you have any method for increasing blog load speed in blogger???