Using the PHP flush method in your website

For those of you looking for greater speed when it comes to website loading times all you need to do is “flush”. A good number of people who are running websites today use PHP to do so.

What you probably didn’t know is that you can use the flush method to clear the buffer when your web page loads because after all slower web page loading times mean fewer visitors and a higher bounce rate. It’s all about keeping those “fans in the stands” when you are developing websites for human consumption.

Using the flush() method

It’s a relatively simple piece of code to use…

  1. Simply locate the head section of your website (Usually noted by the and HTML tags)
  2. Place the following code after the end of the < head > HTML tag…
      ... <!-- css, js -->
    </head>
    <?php flush(); ?>

    <body>
      ... <!-- content goes here!-->
  1. Its Rock N’ Roll time! Now your web pages will flush every time during a page load

I hope that you found this useful for your website and speeding up the performance on your PHP website.

More Articles You Might Like

About Luc Arnold

I am a Web Consultant and Blogger with over 7 years of experience deploying, customizing and working with various web technologies. I am based out of Canada and have a wife and daughter. I love learning new web technologies and techniques and blogging about it all. I also love a good cup of coffee, hanging out with my wife and daughter, reading the latest tech books and newspapers and listening to music.

Speak Your Mind

*

Spam Protection by WP-SpamFree Plugin