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.
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???
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. π
Nice tip, thanks for sharing. I just added in my website and I will report back with results.
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 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. π
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. π
implementing it right now..will check it out how it works..
one of teh simplest thing which works indeed π
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. π
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 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.
Will give it a try…
Sounds too good and simple to be true. Will definitely give it a try to see if it works. Thanx for sharing this.
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.
anybody tried that ?
Many sites! QuickOnlineTips and HBB for example.
going to try this….thanks for sharing Pradeep π
will try this..
It's so simple… Let me try it. I hope it really work on my site too.
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
Nice one
Will deinetly give a try
Implementing it now. Let's see if any noticeable improvements take place.