Go Back   Pligg Forum > Pligg Development > Core Development
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2007, 08:03 PM
Daniel Daniel is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Thumbs up FIX for gzip compression troubles, no .htaccess gzip compression method required

I am using dedicated server and as you know - I had lots of troubles enabling gzip compression on server. Savant helped me do it with htaccess method, but I noticed this method does not speed up site significantly (at least on my server). I found a way to enable gzip compression without htaccess method, and it works perfectly fine:

1st, uncomment AddEncoding:

Code:
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
2nd, uncomment AddType and add AddOutputFilterByType:

Code:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-javascript
3rd, add output filter (it will allow you to process content before it is sent to the client:

Code:
#
AddType text/html .shtml .php .php3 .js .js.gz
AddOutputFilter INCLUDES .shtml .php .php3 .js .js.gz
Now, it works fine without "www". I need to figure out how to make it work with "www".

Any suggestions? It should not be hard for experienced programmers to figure this out.

Update: Just use savant's htaccess method to rewrite base_url. Don't change anything. Just rename htaccess.default to .htaccess (no need to uncomment php_value auto_prepend_file etc). Make sure you have these lines:

Code:
## Remove these two lines if you have a sub-domain like  http://ashdigg.pligg.com  or http://localhost
## Keep if your site it like   http://www.pligg.com
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^\/?(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
##### Re-directing End #####
Reply With Quote
Sponsored Links
Check out the New Modules at the Pligg Pro Shop.
  #2 (permalink)  
Old 02-15-2007, 08:21 PM
kbeeveer46's Avatar
kbeeveer46 kbeeveer46 is offline
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,575
Downloads: 61
Uploads: 6
Thanks: 255
Thanked 649 Times in 514 Posts
for those people who can edit their httpd.conf this may help them but most people can't. I think the reason you are able to edit yours is because you have a dedicated server.
__________________
I accept donations for my time helping users like you on the forum and IRC.

FREE and premium Pligg Web Hosting (NO ads, Includes MySQL, PHP, PHPMyAdmin, and Control Panel) - PM me for discounts on premium packages or if you would like a custom-made package. Paypal accepted.
Reply With Quote
  #3 (permalink)  
Old 02-15-2007, 09:20 PM
Daniel Daniel is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kbeeveer46 View Post
for those people who can edit their httpd.conf this may help them but most people can't. I think the reason you are able to edit yours is because you have a dedicated server.
Yes friend, you are correct, but it may help others who run Pligg on dedicated servers.

Update:

It works like a charm.

Original Size: 68 K
Gzipped Size: 9 K
Data Savings:
86.76%

Last edited by Daniel : 03-01-2007 at 09:41 PM.
Reply With Quote
  #4 (permalink)  
Old 02-15-2007, 11:27 PM
Daniel Daniel is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Damn it. There is a problem. It's gzipped, and it's too damn slow. HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Connection Rate Download Time
14.4K 138.26 seconds
28.8K 77.23 seconds
33.6K 68.51 seconds
56K 47.59 seconds
ISDN 128K 25.81 seconds
T1 1.44Mbps 17.03 seconds

Last edited by Daniel : 02-15-2007 at 11:43 PM.
Reply With Quote
  #5 (permalink)  
Old 02-16-2007, 12:14 AM
Daniel Daniel is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Update, it's slow even with .htaccess enabled, here is comparison (no change in speed...)

php_value auto_prepend_file /absolute-server-path/httpdocs/begin_gzip.php
php_value auto_append_file /absolute-server-path/httpdocs/end_gzip.php

Connection Rate Download Time
14.4K 138.25 seconds
28.8K 77.22 seconds
33.6K 68.51 seconds
56K 47.58 seconds
ISDN 128K 25.81 seconds
T1 1.44Mbps 17.03 seconds


Guys, let's face it. It must be Pligg. Gzip compression is enabled on my server. I even tested it with .htaccess.
Reply With Quote
  #6 (permalink)  
Old 02-16-2007, 04:31 AM
savant's Avatar
savant savant is offline
Pligg Koder
 
Join Date: Apr 2006
Location: UK
Posts: 1,234
Downloads: 7
Uploads: 0
Thanks: 66
Thanked 210 Times in 151 Posts
This is what firebug says.

palluxo.PNG

For some reason it's taking quite a long time to download the gz files.
__________________
Anatomy of the Pligg template Help needed
Reply With Quote
  #7 (permalink)  
Old 02-16-2007, 07:07 AM
kbeeveer46's Avatar
kbeeveer46 kbeeveer46 is offline
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,575
Downloads: 61
Uploads: 6
Thanks: 255
Thanked 649 Times in 514 Posts
Don't you have a shared server that you said works fine? How come I can get Pligg down to 10 secs with 56k and .4 seconds with high speed? I tohught we already came to the conclusion that your dedicated server was causing you problems?
__________________
I accept donations for my time helping users like you on the forum and IRC.

FREE and premium Pligg Web Hosting (NO ads, Includes MySQL, PHP, PHPMyAdmin, and Control Panel) - PM me for discounts on premium packages or if you would like a custom-made package. Paypal accepted.
Reply With Quote
  #8 (permalink)  
Old 02-16-2007, 01:55 PM
Daniel Daniel is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 114
Downloads: 0
Uploads: 0
Thanks: 6
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kbeeveer46 View Post
Don't you have a shared server that you said works fine? How come I can get Pligg down to 10 secs with 56k and .4 seconds with high speed? I tohught we already came to the conclusion that your dedicated server was causing you problems?
Hi kbeever46, yes shared server works fine with respect to gzip compression (I don't have to go to httpd.conf to enable gzip compression there, it works automatically). However, the speed is roughly the same. What I found is that yget template loads much faster than digitalnature template.

Quote:
Originally Posted by savant View Post
This is what firebug says.

Attachment 384

For some reason it's taking quite a long time to download the gz files.
*sigh*.... I have a hunch what might be wrong... and I might be wrong... BUT,
savant, could it be that mod_gzip is the culprit?

mod_gzip is an Internet Content Acceleration module for the popular Apache Web Server. It compresses the contents delivered to the client. There is no need to install any additional software on the client!

http://sourceforge.net/projects/mod-gzip/

Hey... savant, please comment.
Reply With Quote
  #9 (permalink)  
Old 02-16-2007, 02:16 PM
savant's Avatar
savant savant is offline
Pligg Koder
 
Join Date: Apr 2006
Location: UK
Posts: 1,234
Downloads: 7
Uploads: 0
Thanks: 66
Thanked 210 Times in 151 Posts
honestly i don't know. never used it before
__________________
Anatomy of the Pligg template Help needed
Reply With Quote
Reply



Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Gzip compression Daniel Core Development 3 02-14-2007 08:05 AM


LinkBacks Enabled by vBSEO 3.0.0