Use PHP Flush To Improve Site Loading Speed

Written by 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.

PHP Flush Site Speed

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.









HBB RSS
Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic. You will also get instant access to 100+ HBB Guides & Tutorials.
If you wish to subscribe here via Email, then kindly click here.



Editor-in-Chief and Owner of 20 Years Old Kiddo, Open Source Enthusiast, Tech Blogger, Striving Entrepreneur, and a Typical Engineering Student. Addicted to Blogging, Walking and Messing. Catch him on Facebook, Twitter and .


HBB has 666+ Awesome Contributors. [Join HBB].

HellBound Bloggers (HBB) is a part of Slashsquare Network.






31 Responses to “Use PHP Flush To Improve Site Loading Speed”

Leave a Reply


Comments Policy | Brand Your Comments | Do Follow Blog | Top Commentators Award


REFERENCE : 7 Tips To Be A Hero On Blog Commenting [HELPFUL]


Overall HellBound Bloggers (HBB) has 23,573 Genuine Comments and Yours Will Add More Value To It.




Previous Article:

Next Article:

  1. Implementing it now. Let's see if any noticeable improvements take place.

  2. aswin says:

    Nice one
    Will deinetly give a try

  3. Sunil Jain says:

    Well this is a nice tip buddy :) , guess we all 've to give our best to make our blogs load faster :D

    Happy Fast Blogging ;) lol

  4. It's so simple… Let me try it. I hope it really work on my site too.

  5. Shashank says:

    But have to add in which file of wordpress? Stylesheet or other. Please help as I am newbie.

  6. machbio says:

    will try this..

  7. liaqat says:

    going to try this….thanks for sharing Pradeep ;)

  8. Iphone Blogger says:

    anybody tried that ?

  9. Sounds too good and simple to be true. Will definitely give it a try to see if it works. Thanx for sharing this.

  10. Karan Labra says:

    Will give it a try…

  11. Nasif says:

    How will I add it on thesis theme ?

  12. 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 ;-)

  13. sly says:

    How do i implement this on blogger.Just state it in simple way,while i try to work on this

  14. one of teh simplest thing which works indeed ;-)

  15. Rohit Batra says:

    implementing it right now..will check it out how it works..

  16. Shawn says:

    But Which file should I edit to add this code, is it style.css(the stylesheet) or the Index page template???

  17. Nice tip buddy… but will it make any prob with my existing caching plugin ? (hypercache)

  18. Jasmine says:

    This is easy enough. But I wonder if it really improves on the speed?

  19. Nice tip, thanks for sharing. I just added in my website and I will report back with results.

  20. Renji says:

    Hey Pradeep, are you still using PHP Flush? I read this: http://goo.gl/1wZgh on stackoverflow. How was your experience with it?

  21. gary says:

    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???



Subscribe without commenting




COPYRIGHT © 2012 SLASHSQUARE NETWORK. REPRODUCTION WITHOUT EXPLICIT PERMISSION IS PROHIBITED. ALL RIGHTS RESERVED.

Slashsquare
Mobile Version · About Us · Contact Us · Subscription · Advertise · Review · Write For Us · Archives · Privacy Policy · Disclaimer
Loading...
ViperBarUp
ViperBarDown