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 -->
    <?php flush(); ?>

      ... <!-- 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This blog is kept spam free by WP-SpamFree.