Did you know you can use PHP flush function to flush buffer early on your server to speed site loading. Â I was reading this amazing Yahoo! guide aboutÂ best practices for making web pages load faster, and though most other tips were common and practiced by most webmasters for faster site loading, this was new to me.
How does PHP Flush work?
When a page is requested on your server, Â it takes 200-500ms for the backend server to Â stitch the HTML page. While the Â browser is idle as it waits, you can use PHP functionÂ flush() which allowsÂ you to send your partially ready HTML response to the browser so that the browser can start fetching components while your backend is busy with the rest of the HTML page. The benefit is mainly seen on busy backends or light frontends.Â Learn more aboutÂ PHP flush() function, its uses and limitations.
Where to Add PHP Flush in HTML
</head> <?php flush(); ?> <body>
Have you tried PHP flush on your server? Have you noticed a difference in site speed? Every millisecond counts, especially since site speed is a Google search engine ranking factor now.