[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-04 Thread rush
Cf High [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 My lord, this rocks!

 Our pages load at least twice as fast now, and bandwidth will likely be
 reduced by at least a factor of 2.

 I would strongly recommend utilizing zlib compression functions to anyone
 looking to speed page delivery  reduce bandwidth!

I agree on that. It is funny that you often find people spliting hairs on
optimizing code like but templates are slow or even to the extreme should
I use single or double quotes for strings?, while things like this affect
user expirience much, much more.

rush
--
http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-03 Thread rush
Cf High [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Question is, how to implement compression?

 Is it enough to just ini_set() zlib compression to ON? i.e. will all
content
 be automatically be compressed, or do I need to ob_start() 
ob_end_clean()
 at the start and end of each page?

I am not sure about ini_set, I am doing it manually, here is the article
which gave me directions:

http://www.phpbuilder.com/columns/argerich20010125.php3?page=2

rush
--
http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-03 Thread Ammar Ibrahim
if this works for you, could you please post your story in the group. this
is very interesting if you could save 50% of your bandwidth just by turning
the zlib flag :)

good Luck,
Ammar

Cf High [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hey all.

 Having a good problem -- our hockey report site has jumped from 10
 gigs/month to 30+ gigs/month  growing.

 We're getting killed in bandwidth fees at the moment; barring switching to
 another host, will utilizing ZLIB compression significantly reduce
 bandwidth?

 Also, in terms of ZLIB settings, I've ini_set() zlib compression to ON.

 Additionally, do I need to ob_start() ( flush) page output?

 I am uncertain how to implement the following:

 example.php

 ?
 session_start();

 ini_set(zlib.output_compression,ON);
 ini_set(zlib.output_compression_level,4);

 ob_start();

 $page_contents = fopen(** read file contents to variable **);

 ob_end_flush();
 ?

 Thanks for any advice,

 --Noah

 --

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-03 Thread rush
Ammar Ibrahim [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 if this works for you, could you please post your story in the group. this
 is very interesting if you could save 50% of your bandwidth just by
turning
 the zlib flag :)

if you check amount of data that gets transfered from
http://www.moj-posao.net/ (once that images are cached, which is usually
imediately after the first page is loaded) you will see that amount
transfered is is in region of 10k, while the html source of the page is
about 50k. You do the math :) It is also has a great effect on page loading
time for dial-up users.

rush
--
http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-03 Thread CF High
Hey all.

No such luck re: just using ini_set() to compress pages

Rush's link is HIGHLY useful -- thanks Rush!

http://www.phpbuilder.com/columns/argerich20010125.php3?page=2

Works without a hitch in IE 5+ and NN 4.7+ with PHP 4.2.3

--Noah


Ammar Ibrahim [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 if this works for you, could you please post your story in the group. this
 is very interesting if you could save 50% of your bandwidth just by
turning
 the zlib flag :)

 good Luck,
 Ammar

 Cf High [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hey all.
 
  Having a good problem -- our hockey report site has jumped from 10
  gigs/month to 30+ gigs/month  growing.
 
  We're getting killed in bandwidth fees at the moment; barring switching
to
  another host, will utilizing ZLIB compression significantly reduce
  bandwidth?
 
  Also, in terms of ZLIB settings, I've ini_set() zlib compression to ON.
 
  Additionally, do I need to ob_start() ( flush) page output?
 
  I am uncertain how to implement the following:
 
  example.php
 
  ?
  session_start();
 
  ini_set(zlib.output_compression,ON);
  ini_set(zlib.output_compression_level,4);
 
  ob_start();
 
  $page_contents = fopen(** read file contents to variable **);
 
  ob_end_flush();
  ?
 
  Thanks for any advice,
 
  --Noah
 
  --

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-03 Thread CF High
My lord, this rocks!

Our pages load at least twice as fast now, and bandwidth will likely be
reduced by at least a factor of 2.

I would strongly recommend utilizing zlib compression functions to anyone
looking to speed page delivery  reduce bandwidth!

--Noah



Rush [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Ammar Ibrahim [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  if this works for you, could you please post your story in the group.
this
  is very interesting if you could save 50% of your bandwidth just by
 turning
  the zlib flag :)

 if you check amount of data that gets transfered from
 http://www.moj-posao.net/ (once that images are cached, which is usually
 imediately after the first page is loaded) you will see that amount
 transfered is is in region of 10k, while the html source of the page is
 about 50k. You do the math :) It is also has a great effect on page
loading
 time for dial-up users.

 rush
 --
 http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-02 Thread rush
Cf High [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Having a good problem -- our hockey report site has jumped from 10
 gigs/month to 30+ gigs/month  growing.

 We're getting killed in bandwidth fees at the moment; barring switching to
 another host, will utilizing ZLIB compression significantly reduce
 bandwidth?

well it depends what uses most of your bandwith. If it is for images, then
compression will not help much since images are allready compressed. In that
case, you may save much more if you can put images in some directory and
tell apache to allow cacheing for that directory.

On the other hand if your bandwith goes mainly on thransfer of html source
for the pages then compression can shave up to 80% of your bandwith usage.

rush
--
http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Zlib Compression || Implementation || Bandwidth Savings?

2004-02-02 Thread CF High
H

Looks like the majority of sent bandwidth is html, not image files  ratio
is at least 10:1 html to images.

With that in mind, setting zlib compression to ON seems the way to go.

Question is, how to implement compression?

Is it enough to just ini_set() zlib compression to ON? i.e. will all content
be automatically be compressed, or do I need to ob_start()  ob_end_clean()
at the start and end of each page?

TIA for any clues -- I'm obviously confused about compression
techniques.

--Noah



Rush [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Cf High [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Having a good problem -- our hockey report site has jumped from 10
  gigs/month to 30+ gigs/month  growing.
 
  We're getting killed in bandwidth fees at the moment; barring switching
to
  another host, will utilizing ZLIB compression significantly reduce
  bandwidth?

 well it depends what uses most of your bandwith. If it is for images, then
 compression will not help much since images are allready compressed. In
that
 case, you may save much more if you can put images in some directory and
 tell apache to allow cacheing for that directory.

 On the other hand if your bandwith goes mainly on thransfer of html source
 for the pages then compression can shave up to 80% of your bandwith usage.

 rush
 --
 http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php