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.

Website Experts runs on the Genesis Framework

Genesis Framework

Genesis has empowered me to quickly and easily build this great website with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis today!


Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog after all its what we use at the Website Experts


Speak Your Mind

*

Spam Protection by WP-SpamFree Plugin