Forgot Password / Register
Site Statistics
Total Members: 510
Total Tutorials: 242
Newsest User: Hp
Todays Unique Hits: 127
0 Users 4 Guests Online

Speed Up Your Loading Time without cutting down scripts!

PHP Code
1
2
3
4
5
6
7
8
9
<?
ini_set
('zlib.output_compression_level'5);
#set the ini file with the compression level of your choice.
#where 5 is you can change the compression level, it can be as high as 9 and as low as 0.
#but be careful not to have to much compression, it can result in slow page loads

ob_start("ob_gzhandler"); 
#now we will use output buffering to run the compression, make sure you put this at the very, very top of the pages you want compressed
?>



By the way, I use level 7 or 8 in compression, seems to work best for my site, one page used to take 16 seconds on my site to load with cashed clear, and ran the compression with cashed clear and it took about 5 seconds on level 8.

Hope you learnt a little and if everybody did this, we could make the internet a nice and fast loading, many forum systems compress their files, like phpbb and sm forums, if you want to do this with your forums and you find that it isn't running the compression, there should be an option in the admin panel, otherwise you can try adding it yourself.

~~~~~Chris M
chrism
Author:
Views:
1692
Rating:
Posted on Saturday 1st March 2008 at 06:50 PM
ShadowMage
ShadowMage
btw its cache =P
Posted on Wednesday 17th October 2007 at 05:58 AM
MCP
MCP
^ Simple place that code into a file and call it compress.php or something. Then use a php include script on your pages. That way if change should need to come to the compression code... you won't have to put it on each page.
Posted on Friday 17th August 2007 at 05:39 PM
ilyas-shezad
ilyas-shezad
Hi i hope ur still active cuz i wanted to ask if this works in a configuration file so u dont need to put it on every single page on ur website? thanks