View Single Post
  #1 (permalink)  
Old 01-28-2007, 10:05 PM
Adaman's Avatar
Adaman Adaman is offline
Constant Pligger
 
Join Date: Jan 2007
Location: Scotland
Posts: 111
Thanks: 23
Thanked 17 Times in 7 Posts
Gzip Technique That Boosted my load times

Hi Guys,

I have been playing around with pligg and noticed that i was getting some slow load times. I read through a couple of threads here and was alerted to the fact that maybe gzip was not activated. I tested my sites http://www.p2pvine.info/ and http://www.gamblingvine.info/ and lo and behold gzip was disabled/off.

Reading and searching the forums i tried a few suggestions including the digitalnature mod for gzip but it didnt give me much improvment. And as p2pvine uses mollio-beat as it's template the digitalnature hack wasnt much use.

So what was my solution that greatly improved my load times from somtimes 6 - 9 seconds to 1 -3.

Check is your site is gzipped or not - http://leknor.com/code/gziped.php

First off you need 2 make 2 php files called

begin_gzip.php
Code:
<?php
ob_start("ob_gzhandler");
?>
Place the code above in your file and save it as begin_gzip.php

end_gzip.php
Code:
<?php

ob_flush();

?>
Place the code above in your file and save it as end_gzip.php

okay you need to add 2 lines to your .htaccess file also for this to work.

.htaccess
Code:
php_value auto_prepend_file /home/user/path/to/begin_gzip.php
php_value auto_append_file /home/path/to/end_gzip.php
You need to include the two lines above to your htaccess file, remembering to change the path to the PHP files as required. The path must be the absolute server path.

Upload the 3 files

.htaccess
begin_gzip.php
end_gzip.php

To your pligg directory root and you should be good to go.

Again check your site for gzip - http://leknor.com/code/gziped.php

You should now browse your site and hopefully notice some drastic improvmentsin the speed. I know this is not the ideal fix but until the dev's (Who we should thank for all the great work thay do on pligg ) come up wih a better solution.

I tried all previous suggestions on the forum and after testing this way seems to work best by far. Any feedback from others that have tried this solution and there results would be appreciated.

Enjoy

Adaman

NOTE: If you have a fourm installed on the same domain name as plig and in a sub folder like http://www.your-domain.com/forum/ etc you will need to disable you forums gzip option. This can be done from you forum software control panel.

phpbb - will give you mysql errors otherwise
VBulletin - Will look like encoded text if you do not diable it's gzip

This gzip technique covers the whole domain so any foums installed in a sub-folder will get errors if you do not disable there gzip functions.

if your forums are on a sub domain like forums.your-domain.com you need the forums gzip enabled

Last edited by Adaman; 02-02-2007 at 05:39 PM..
Reply With Quote
The Following 10 Users Say Thank You to Adaman For This Useful Post: