Tuesday, February 12, 2008

Improve page load time in PHP

Improve page load time with a class and 3 lines of PHP


Here's a PHP script from Leon Chevalier which improves your page load time drastically. His compressor class improves your site's performance by combining and minifying the css, Javascript and HTML files on the page, allowing for fewer HTTP requests and smaller sizes of these files. All you need to do is to download the class file and add the following php lines at the top of your page

require_once('class.compressor.php');
$compressor = new compressor('css,javascript,page');

and the following line of PHP code at the end of your page

$compressor->finish();

Read more about this script and see the benchmarks of this over at: Aciddrop.com| Improve website load time by 500% with 3 lines of code

No comments:

Post a Comment