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…
- Simply locate the head section of your website (Usually noted by the and HTML tags)
- Place the following code after the end of the < head > HTML tag…
... <!-- css, js --> </head> <?php flush(); ?> <body> ... <!-- content goes here!-->
- 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.