Go Back   PHP Link Directory Forum > PHP Link Directory (phpLD) > Mods and contribution Discussion

Mods and contribution Discussion This forum is only for discussion of modding phpLD. For specific mod releases, please see the appropriate forum.

Closed Thread
 
Thread Tools Display Modes
Old 01-21-2006   #1
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default Make your directory Fly: How to GZIP Compress

I am not a programmer however I do have some tricks I can show to people that may not know how to speed up your directory. The answer is to use GZIP or compression technology like the big guys yahoo, msn, and google.

how?
You can easily shave off almost half of your bandwidth and download time for your directory using GZIPPING....

most hosts use it if they use PHP....

how to apply this "mod" (its the easiest of em all!):

open index.php
before ANY code add this:

<?php
ob_start( 'ob_gzhandler' );
?>

You are done!! To get a feel for how much speed you gained and bandwidth check:
http://www.websiteoptimization.com/services/analyze/

Compare before and after....

I gzipped my css file to 1/3 its original size using two things:
1)
http://www.cssdrive.com/index.php/main/csscompressor/

and
2)
then changing the css file type from .css to .php and adding
<?php
ob_start ("ob_gzhandler");
header("Content-type: text/css; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
?>

to the top of the php file

Make sure you refer to the php (css) file in the following way:
<style type="text/css">
@import url("http://www.yoursite.com/pathto/cssfilename.php");
</style>

im done my first contribution...if you call it that :P

KNOWN PROBLEMS: may influence MSN rankings? (not sure 100%) - please post here if you know anything about Gzipping and MSN SERPS

Last edited by gustotelmy; 07-10-2006 at 07:36 AM.
gustotelmy is offline  
Old 01-21-2006   #2
gamecock
 
Join Date: Jan 2006
Posts: 7
Default

Wow, what huge site speed increase! Thanks!
gamecock is offline  
Old 01-21-2006   #3
Moncal
 
Join Date: Oct 2005
Posts: 28
Default

You're my hero!

I'm on dialup and my directory just literally loaded in 2 seconds!
Moncal is offline  
Old 01-21-2006   #4
dagger
Supporter
 
Join Date: Dec 2005
Posts: 22
Default

nice work dude

its better by 60%
__________________
Please double check your sig link
dagger is offline  
Old 01-21-2006   #5
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default you are welcome !

you are welcome ! I am trying to give back to this great community...

it works in other php documents too such as your main pages also...

all the best
gustotelmy is offline  
Old 01-22-2006   #6
David
Administrator
phpLD Administrator
Supporter
 
David's Avatar
 
Join Date: Jan 2005
Posts: 11,667
Default

Interesting...I will have to test this for 3.0.
I'm starting to get the dev area setup, and soon we'll start combing the forums for miscellaneous bug fixes and improvements.
David is offline  
Old 01-22-2006   #7
Ap0s7le
 
Join Date: Jun 2005
Location: The world
Posts: 816
Send a message via ICQ to Ap0s7le Send a message via AIM to Ap0s7le Send a message via MSN to Ap0s7le Send a message via Yahoo to Ap0s7le Send a message via Skype™ to Ap0s7le
Default

David, I was thinking the same thing.



later
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
http://www.ap0s7le.com
Need help with PHPLD? PM me
Ap0s7le is offline  
Old 01-22-2006   #8
resource
 
Join Date: Jan 2006
Posts: 8
Default

You can do it from php.ini for every PHP script easily, just edit your php.ini and find zlib.output_compression and set it to On like:
zlib.output_compression = On
Don't touch anything else, and restart your Apache.

Cheers
resource is offline  
Old 01-23-2006   #9
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default glad everyone likes it!

glad everyone likes it!

the cool thing is it works for people that have browsers enabled for compression ie 99% of them, the rest the server just serves up the un-compressed copy so need to worry about losing visitors...

gustotelmy is offline  
Old 04-18-2006   #10
gearoid
 
Join Date: Mar 2006
Location: Ireland
Posts: 93
Default

Excellent,
Thank you.
__________________
Directory Ireland
Castlegar Galway
gearoid is offline  
Old 04-19-2006   #11
Brandon Sheley
 
Brandon Sheley's Avatar
 
Join Date: Feb 2006
Posts: 530
Default

works for me, thank you
__________________
My Forum: vBulletin Setup and you might be interested in our vBulletin Services
My Directories: Quality Link Directory - Deep Links - Link Directory - vBulletin Directory
Brandon Sheley is offline  
Old 06-22-2006   #12
vignesh_natraj
 
vignesh_natraj's Avatar
 
Join Date: Feb 2006
Posts: 100
Default

great post i didn't use it for phpLD but another php script
the result was great thank you
__________________
Please check your sig links (they were parked)
vignesh_natraj is offline  
Old 06-23-2006   #13
kentuckyslone
 
Join Date: May 2006
Posts: 66
Default

Very good! According to http://www.websiteoptimization.com/services/analyze/ my home page went from 19 seconds to 12 seconds for the slowest (14.4) connection speed after making this change.
kentuckyslone is offline  
Old 07-06-2006   #14
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default

love to see people using it!
gustotelmy is offline  
Old 07-06-2006   #15
Boby
Supporter
Moderator
 
Boby's Avatar
 
Join Date: Dec 2005
Location: Cluj-Napoca/Sighisoara (Romania)
Posts: 4,468
Default

It can be done also from your .htaccess file:
Code:
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
But make sure your hoster and webserver allows it, else you'll get a 500/Internal Server Error if it's disabled.

Boby
__________________
wanna say thank you?
  • My phpLD Mods
  • I am *not* a phpLD staff member, so please do *not* ask me to grant permissions, sales stuff, for access to the private supporter forums or phpLD 3.0+ download area.
  • Before you report your problems, make sure it happens with the *default* package and not your highly modified code. Don't forget to use the search feature and do not *bump* threads to soon (allow at least 24h).
Boby is offline  
Old 07-06-2006   #16
Brandon Sheley
 
Brandon Sheley's Avatar
 
Join Date: Feb 2006
Posts: 530
Default

when this was enabled on 3.0.5 i had description errors from search results :(
__________________
My Forum: vBulletin Setup and you might be interested in our vBulletin Services
My Directories: Quality Link Directory - Deep Links - Link Directory - vBulletin Directory
Brandon Sheley is offline  
Old 07-06-2006   #17
Brandon Sheley
 
Brandon Sheley's Avatar
 
Join Date: Feb 2006
Posts: 530
Default

ya, i get a lot of traffic from msn, so I had to disable this :(
__________________
My Forum: vBulletin Setup and you might be interested in our vBulletin Services
My Directories: Quality Link Directory - Deep Links - Link Directory - vBulletin Directory
Brandon Sheley is offline  
Old 07-06-2006   #18
CyberGrenade
 
Join Date: Jul 2006
Posts: 13
Default Great!

I noticed a HUGE difference in my Directory. Thanks for the post.
__________________
http://www.cybergrenade.com

I also enjoy photography.
CyberGrenade is offline  
Old 07-10-2006   #19
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default

Quote:
Originally Posted by anon
I was highly pissed off because I was ranked 5th on msn for some extreeeeemely high searched keyword phrases, and now because of the compression, my title is 1. borked to hell 2. I am nowhere in site now.
I was doing between 4-600 in ypn a month and now i barely hit 100.

grrrrrr

hmm are u serious? **censored****censored****censored****censored**. Msn better wake up this is important to speed up the net. I never thought of SEO implications although I consider myself a pretty good SEOer... sorry for this :(
gustotelmy is offline  
Old 07-10-2006   #20
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 182
Default

Quote:
Originally Posted by Boby
It can be done also from your .htaccess file:
Code:
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
But make sure your hoster and webserver allows it, else you'll get a 500/Internal Server Error if it's disabled.

Boby

cool! that is easier
gustotelmy is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:44 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.