FIX for gzip compression troubles, no .htaccess gzip compression method required

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2007, 09:03 PM
Constant Pligger
 
Join Date: Feb 2007
Posts: 109
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
  #2 (permalink)  
Old 02-15-2007, 09:21 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
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.
Reply With Quote
  #3 (permalink)  
Old 02-15-2007, 10:20 PM
Constant Pligger
 
Join Date: Feb 2007
Posts: 109
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 10:41 PM.
Reply With Quote
  #4 (permalink)  
Old 02-16-2007, 12:27 AM
Constant Pligger
 
Join Date: Feb 2007
Posts: 109
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-16-2007 at 12:43 AM.
Reply With Quote
  #5 (permalink)  
Old 02-16-2007, 01:14 AM
Constant Pligger
 
Join Date: Feb 2007
Posts: 109
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, 05:31 AM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,181
This is what firebug says.

FIX for gzip compression troubles, no .htaccess gzip compression method required-palluxo.png

For some reason it's taking quite a long time to download the gz files.
Reply With Quote
  #7 (permalink)  
Old 02-16-2007, 08:07 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
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?
Reply With Quote
  #8 (permalink)  
Old 02-16-2007, 02:55 PM
Constant Pligger
 
Join Date: Feb 2007
Posts: 109
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, 03:16 PM
savant's Avatar
Constant Pligger
 
Join Date: Apr 2006
Location: UK
Posts: 1,181
honestly i don't know. never used it before
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess rename issues URL method 2 issues eiro0701 Questions and Comments 2 03-27-2009 08:38 AM
Gzip enabled in both admin and .htaccess? ditto Questions and Comments 2 01-16-2008 10:39 AM
Why is Pligg slow even with gzip compression? Daniel Questions and Comments 19 06-22-2007 04:07 PM
Gzip compression causing problems rhythm Questions and Comments 3 05-11-2007 02:15 AM
Gzip compression Daniel Questions and Comments 3 02-14-2007 09:05 AM


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