Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2001, 11:37 PM
Kier Kier is offline
 
Join Date: Oct 2001
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was playing around with this for a site I'm building, and it occured to me that it would work fine for vB 1.x too, so here you go.

Open your admin/config.php and paste the following code at the end of the file, before the ?> tag.

PHP Code:
<?php

// original bits of config.php go here

$gziplevel 1;

function 
compress_output($output) { 
    global 
$gziplevel;
    return 
gzencode($output,$gziplevel);
    }
    
if (
strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') && ($gziplevel != 0)) {
    
ob_start("compress_output");
    
header("Content-Encoding: gzip"); 
    } 
?>
This code is adapted from the reference script at zend.com, but with the addition of the ability to set the zip compression level. You can alter the line $gziplevel = 1; to use any number between 0-9 (0 is no compression), but i've found that for my site, a level of 1-3 gives the best balance of speed against CPU loading.

Once you have installed the code snippet, you can test that it's working by a) trying to access your forums b) inputting your URL here (you need to specify the .php file, rather than just the directory) http://leknor.com/code/gziped.php

Of course, you will need to have PHP built with zlib support for this to work. Find out by running a phpinfo() script...
Reply With Quote
  #2  
Old 02-02-2001, 02:08 PM
Guest
 
Posts: n/a
Default

If you have PHP 4.04pl1, and you want to just compress ALL php on your site, edit your php.ini file to read this:
output_handler = ob_gzhandler

Have to have PHP 4.04pl1, and compile it to use zlib...

Chris
Reply With Quote
  #3  
Old 02-02-2001, 04:44 PM
Guest
 
Posts: n/a
Default

Dosn't work for me, I just get a blank screen.

The Site is on Datablocks.net

If I set it to 1 it works

2 or above gives me a blank screen
Reply With Quote
  #4  
Old 02-02-2001, 04:55 PM
Guest
 
Posts: n/a
Default

wow! even with it set to 1, the difference was noticed
Reply With Quote
  #5  
Old 02-02-2001, 07:34 PM
Guest
 
Posts: n/a
Default

For me it doesn't work with 1 either...
Reply With Quote
  #6  
Old 02-02-2001, 07:37 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by -saturn-
For me it doesn't work with 1 either...
You're server must have php4 and zlib
Reply With Quote
  #7  
Old 02-02-2001, 08:13 PM
Guest
 
Posts: n/a
Default

I'm hosted at www.nomontlyfees.com

I know they have php4, but how can I find if they have zlib?
Reply With Quote
  #8  
Old 02-02-2001, 08:17 PM
Guest
 
Posts: n/a
Default

Easy! Go to yourdomain.com/forum/admin/index.php?action=phpinfo

You should find something like this:
Attached Images
File Type: jpg zlib.jpg (13.2 KB, 0 views)
Reply With Quote
  #9  
Old 02-02-2001, 08:22 PM
Guest
 
Posts: n/a
Default

I'm sorry to say but I didn't find it...
Reply With Quote
  #10  
Old 02-08-2001, 11:05 AM
Guest
 
Posts: n/a
Default

Where can we get zlib?
Reply With Quote
Reply


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. The time now is 10:03 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.05844 seconds
  • Memory Usage 2,249KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (1)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete