vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   gzip compression: howto (https://vborg.vbsupport.ru/showthread.php?t=37709)

iAlex 04-21-2002 02:58 PM

gzip compression: howto
 
Greetings,

I have vbulletin running, of course, with gzip compression enabled. Since my connection is reasonably fast, I hardly notice a significant difference between php pages that are compressed (the forum) and those that aren't (the rest of the site).

But today traffic was soaring and the site was slooow, whereas the forum was ok. What I'm wondering is how can I set all the other php pages to use the compression, I assume it shouldn't be a problem since everything needed is already there, used by the forum. How can I "turn it on" for the rest of the site?

Let me know if you need any specific info.

Any help much appreciated!!!

whizkid 04-21-2002 03:53 PM

Hi,

try setting following PHP code at the top of all PHP sites, whom you want to have GZ compression activated:

PHP Code:

ob_start("ob_gzhandler"); 


whizkid

Scott MacVicar 04-21-2002 04:10 PM

The site could have been slow due to the extra cpu time required to compress the content before sending it to the client.

The gzip compression is designed to reduce bandwidth which will reduce loading time for most people, less time to download page = faster loading.

I have noticed that with alot of users on all wanting gzipped pages that the server load jumps up a great deal.

iAlex 04-21-2002 07:16 PM

whizkid, that's all it takes? Does that mean it uses the same settings (ie. compression level) as I have set for the forum?

And how do I check whether the compression is on or off, whether it's working or not?

Finally, does the code have to be the first line of code in the file, ie. before the html code starts? Or doesn't it matter where it is?

PPN, I am aware of that, but in this case I had in mind the compression. My site is on a large server with a lot more sites so the difference in load should not be spectacular. Moreover, I am quite convinced it was a question of bandwidth this time.

Scott MacVicar 04-21-2002 07:55 PM

the code would have to be before any information was sent to the browser

whizkid 04-21-2002 08:14 PM

Hi,

well it works for me ;). You could check by loadeing a page without the compression activated and then with the compression activated and see if it makes a difference.
I put my code before any output to the browser happens.


whizkid

Quote:

Originally posted by iAlex
whizkid, that's all it takes? Does that mean it uses the same settings (ie. compression level) as I have set for the forum?

And how do I check whether the compression is on or off, whether it's working or not?

Finally, does the code have to be the first line of code in the file, ie. before the html code starts? Or doesn't it matter where it is?


PPN, I am aware of that, but in this case I had in mind the compression. My site is on a large server with a lot more sites so the difference in load should not be spectacular. Moreover, I am quite convinced it was a question of bandwidth this time.


wooolF[RM] 04-22-2002 01:02 PM

]
Quote:

Originally posted by whizkid
Hi,

try setting following PHP code at the top of all PHP sites, whom you want to have GZ compression activated:

PHP Code:

ob_start("ob_gzhandler"); 


whizkid

erm... sorry for newbie question... do I have to set it in all php pages or in all templates or... ? I'm just lost...
If it's in templates, can I just set it in the header?

Scott MacVicar 04-22-2002 02:04 PM

as long as you set it in a php file that is called on every page, i have a header.php file which is called on every page on my site, so you could just add it to that and as long as the script includes header.php it will run it.

iAlex 04-22-2002 02:50 PM

It's not working. :( I copied one of your page that I assume are outside the forum and using the code you posted: http://www.php4-forum.com/php_tutorials/.

I made two versions, one with only the php code and the html and another with <? ob_end_flush() ?> at the very end. None of them work, I can't seem to load them in any of the browsers I've tried with. Have a look:
http://www.juventuz.com/home/gzip/

When I try to load either one, IE gives me a dns error. What do you think the problem is?

bigmattyh 04-23-2002 06:30 PM

By the way, gzip will NOT compress images -- only text. So if the rest of your site has images galore, that could explain why you aren't seeing an improvement on the rest of your site.


All times are GMT. The time now is 09:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02207 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete