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
 
topic widgets
Old 01-21-2006   #1
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 180
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 06:36 AM.
gustotelmy is offline  
Old 01-21-2006   #2
gamecock
 
Join Date: Jan 2006
Posts: 6
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: 20
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: 180
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-21-2006   #6
David
Administrator
phpLD Administrator
Supporter
 
David's Avatar
 
Join Date: Jan 2005
Posts: 12,325
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: 813
Default

David, I was thinking the same thing.



later
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
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: 180
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: 534
Default

works for me, thank you
Brandon Sheley is offline  
Old 06-22-2006   #12
vignesh_natraj
 
vignesh_natraj's Avatar
 
Join Date: Feb 2006
Posts: 101
Default

great post i didn't use it for phpLD but another php script
the result was great thank you
__________________
Stub Pages - Bounce Rates
vignesh_natraj is offline  
Old 06-23-2006   #13
kentuckyslone
 
Join Date: May 2006
Posts: 69
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: 180
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,524
Default

It can be done also from your .htaccess file:
Code:
Content visible to registered users only.
But make sure your hoster and webserver allows it, else you'll get a 500/Internal Server Error if it's disabled.

Boby
__________________
Please do *not* contact me for support on phpLD!! I can hardly find time to give support for my own mods, for anything else I won't.
  • 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 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: 534
Default

when this was enabled on 3.0.5 i had description errors from search results :(
Brandon Sheley is offline  
Old 07-06-2006   #17
Brandon Sheley
 
Brandon Sheley's Avatar
 
Join Date: Feb 2006
Posts: 534
Default

ya, i get a lot of traffic from msn, so I had to disable this :(
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.
__________________
I also enjoy photography.
CyberGrenade is offline  
Old 07-10-2006   #19
gustotelmy
Supporter
 
Join Date: Nov 2005
Posts: 180
Default

Code:
Content visible to registered users only.

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: 180
Default

Code:
Content visible to registered users only.

cool! that is easier
gustotelmy is offline  
Closed Thread

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
topic widgets



All times are GMT +1. The time now is 05:56 PM.


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