Gzip Technique That Boosted my load times

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-28-2007, 10:05 PM
Adaman's Avatar
Constant Pligger/Designer
Pligg Version: v9.8.2
Pligg Template: Custom
 
Join Date: Jan 2007
Location: Scotland
Posts: 101
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
  #2 (permalink)  
Old 01-28-2007, 10:18 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Thanks for the suggestions. It's these types of forum threads that define what open source is.
Reply With Quote
  #3 (permalink)  
Old 01-29-2007, 08:12 PM
Constant Pligger
 
Join Date: Apr 2006
Location: USA
Posts: 351
great research and explanation!

I noticed as well that my pligg site takes around 6 seconds to load, taking it down to 1 or 2 would rock!

I'm glad to hear it will be in the next version of pligg, I cant wait for this part alone! haha
Reply With Quote
  #4 (permalink)  
Old 01-30-2007, 04:02 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
I have added the gzip feature to Pligg. I didn't notice a huge change but I went ahead and added it. It's disabled by default until you edit the htaccess file with your correct server path.
Reply With Quote
  #5 (permalink)  
Old 02-01-2007, 06:53 PM
Adaman's Avatar
Constant Pligger/Designer
Pligg Version: v9.8.2
Pligg Template: Custom
 
Join Date: Jan 2007
Location: Scotland
Posts: 101
Quote:
Originally Posted by en3r0 View Post
great research and explanation!

I noticed as well that my pligg site takes around 6 seconds to load, taking it down to 1 or 2 would rock!

I'm glad to hear it will be in the next version of pligg, I cant wait for this part alone! haha
Your first call to pligg will always be a little slow unless a good template cache system is figured out. But this gzip technique should speed up the page loads after the initial compile so you should notice a difference when browsing pligg generally.

Plus it saves some page size bu compression.

Quote:
Originally Posted by kbeeveer46 View Post
I have added the gzip feature to Pligg. I didn't notice a huge change but I went ahead and added it. It's disabled by default until you edit the htaccess file with your correct server path.
Cool should help some out a little with implementation and hopefully one less question for the beeveer and yanki to constantly answer haha

Last edited by Adaman; 02-02-2007 at 12:08 PM.
Reply With Quote
  #6 (permalink)  
Old 03-16-2007, 05:17 PM
mgk mgk is offline
New Pligger
 
Join Date: Mar 2007
Posts: 1
When I enable gzip through the configuration pages it screws up my site to the point where I can no longer edit the configuration (the editable fields stop being editable) and I get a js error on pretty much every page.

I uploaded the .htaccess file and I tried several settings for the path but I could never get it to work. The only way I could make the site work again was by going into the DB and overwriting the gzip setting back to false.

What am I doing wrong, I would like to get gzip working but everytime I try it screws everything up.

Thanks for any info.
Reply With Quote
  #7 (permalink)  
Old 03-16-2007, 05:37 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
You are doing everything right but some servers cannot handle gzipped files and that is why none of the javascript files work after enabling gzip. I have no idea what you need installed for gzip to work. I only know that some servers can handle them and others can't. There is one more method of gzip that you can enable and that is inside the .htaccess file.
Reply With Quote
  #8 (permalink)  
Old 03-16-2007, 06:58 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
It might also help if you posted a link to a webpage with the phpinfo() call on your server, as it might shed some light on what it supports.
Reply With Quote
  #9 (permalink)  
Old 10-20-2007, 10:30 AM
Casual Pligger
Pligg Version: 9.6
Pligg Template: yget, molli
 
Join Date: Jul 2007
Posts: 30
Send a message via MSN to sadegazoz
thanks for this nice post but i didnt manage to work it in pligg 9.7 . ive asked my hosting company godaddy about the absolute path which i didnt manage to find and
here is what i ask them and their answer

"Dear Sir/Madam, Thank you for contacting Online Support. The full server path would be in the following format:

home/content/u/s/e/username/html/

Please note the three letters in the middle would be the three first letters of your hosting username. Please let us know if we can help any other way."


"Customer Inquiry
hi,
im the owner of xyz.com
im trying to activate gzip configuration for my site but didnt manage to
find absolute path for it.
it should be something like this php_value auto_append_file
/home/path/to/end_gzip.php
could you please tell me whats it?"


when my db name is krishna what i did is
1- change the "Enable Gzip File Compression" from admin panel to true;
2- after that open my htaccess.default file
3- remove the two # from both lines (line 3 and 4) and change it like this
php_value auto_prepend_file /home/content/k/r/i/krishna/html/begin_gzip.php
php_value auto_append_file /home/content/k/r/i/krishna/html/end_gzip.php
4- and change the htaccess.default file name to htaccess

but all of these didnt work for me? what am i missing can blank part in
php_value auto make this?
or should i also change the "/content/" part too?

thanks for any commands and help.

please help
thanks a lot

Last edited by sadegazoz; 10-20-2007 at 10:36 AM.
Reply With Quote
  #10 (permalink)  
Old 10-20-2007, 12:16 PM
Casual Pligger
Pligg Version: 9.6
Pligg Template: yget, molli
 
Join Date: Jul 2007
Posts: 30
Send a message via MSN to sadegazoz
any help or command will be appreciated
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
gzip for n00bs tones Questions and Comments 0 08-09-2007 06:53 AM
Problem enabling Gzip ozo Questions and Comments 6 05-19-2007 03:50 PM
Gzip in Pligg 9.0? Hellevator Questions and Comments 0 04-19-2007 08:55 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development