spacer
spacer
spacer
spacer
spacer
spacer
UBB Developers Network UBB Developers Network
spacer
spacer
spacer
UBBDev Modspace
Recent Issues

Articles
Articles of Interest for the UBB Developer

Reviews
Grab Reviews of all (software, hardware, sites) that's important to you as a developer.

Interviews
Interviews in the world of internet community-building.

Member Spotlight
Grab Honorees for excellence in site design, color scheme, member experience, appropriate use of modifications, and site integration.


Team UBBDev

Join the Team!
Team UBBDev is our name for the United Devices cancer research project started here at UBBDev.

Join today and donate your computer's unused CPU time to a worthy cause. When you sign up, you'll be helping to search for a cure for cancer, and you'll also get a nifty haxxor icon.

UBBDev Haxxor Icon
Fig. 1-1: Nifty haxxor icon.
spacer

UBBDev.com Post New Topic  
my profile | directory login | register | search | faq | forum home

  next oldest topic   next newest topic
» UBBDev.com » "U" zine » Articles » Featured 6.1.0 Modification : File Compression with cgi_buffer.pm

 - UBBFriend: Email this page to someone!    
Author Topic: Featured 6.1.0 Modification : File Compression with cgi_buffer.pm
AllenAyres
Administrator


 - posted      Profile for AllenAyres     Send New Private Message       Edit/Delete Post 
Featured 6.1.0 Modification : File Compression

Discussion: http://www.ubbdev.com/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=30&t=000049

If you run on a dedicated server and have had your head stuck in the sand for the last, oh, 4 hours, you've missed one of the more useful modifications to come out in a long while for UBB™ forums and forums in general. No more enduring sneering chants of "We've got compression, yes we do! We've got compression, how about you?" You too can have file compression for your forum and watch as the bandwidth and download time plummets!

First, a thank you to Wild for pointing out this module to the rest of us slow people, too bad we didn't know about it a year ago when it came out.

What :: This is a perl module you can install on your server to provide up to 70% bandwidth savings in a matter of minutes. Developed by Mark Nottingham , it is simple to install and is very recommended once you weigh the caveats. The compression => bandwidth savings + increase in download speed is great, but with it comes a increase in CPU usage as the server has to work to compress the files. Weigh this con against the pro and give it a shot on your server, you may be pleasantly surprised at the increase in speed.


How :: Obtain the files and instructions for installing it on Unix servers from here: http://www.mnot.net/cgi_buffer/

Requirements:

cgi_buffer.pm is a Perl ( http://www.perl.com/ ) library, and has been tested with Perl 5.004, on Linux. There should be no great issues using it with Windows platforms, but the author has little experience using CGI on them, and CANNOT SUPPORT WINDOWS INSTALLATIONS.

The following libraries need to be installed; see CPAN ( http://www.cpan.org/ ) for more information:

* MD5
* IO::String
* Compress::Zlib

Servers with recent installations of ActiveState perl (5.6.1 preferred - http://www.activestate.com - including Windows servers) already have these modules installed. Obtain the cgi_buffer files from the above address and install.

If you have a windows server (Win2K/IIS5 has been tested), just copy the cgi_buffer.pm file to your C:\perl\lib directory and you're set as far as installation.

Open ultimatebb.cgi, uncomment use strict; and use vars etc etc (lines #30 and #35) and add this:
require cgi_buffer;
immediately after your use strict; so that it looks like this:

use strict;
require cgi_buffer;
use Fcntl ':flock';
use UBBCGI qw(:cgi);
use UBBCGI::Carp qw(fatalsToBrowser set_message);

use vars qw(%etc etc

If you are getting errors that include "Status: 304 Not Modified " add :
$cgi_buffer::generate_etag = 0;
immediately after require cgi_buffer; so that it looks like this:

use strict;
require cgi_buffer;
$cgi_buffer::generate_etag = 0;
use Fcntl ':flock';
use UBBCGI qw(:cgi);
use UBBCGI::Carp qw(fatalsToBrowser set_message);

use vars qw(%etc etc

That should be all you need to do, tho you may want to clear cache...

You may also use the Apache Module mod_gzip if you are running an Apache server. If you are on a Windows server the native ISAPI compression module is already installed and performs better than either method, you will need to set it to compress cgi/pl tho.

Resources:

Win2K: http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodtechnol/iis/maintain/optimize/perflink.asp
http://support.microsoft.com/support/kb/articles/Q255/9/51.ASP

Apache: http://www.remotecommunications.com/apache/mod_gzip/ http://www.extremeoverclocking.com/articles/howto/mod_gzip_1.html

UBBDev: http://www.ubbdev.com/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=10&t=000990


IP: Logged | Report this post to a Moderator
   

Post New Topic   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | UBBDev.com

Powered by UBB.classic™ 6.7.3

Our Sponsors


Advertise Here

Dell Business Weekly Promo

U-Store

Accessories
Decorate your desktop with official UBBDev mugs n' mousepads!

Clothing Items
Stay warm this winter with an official UBBDev sweatshirt on your back!

spacer
spacerCopyright 2002 UBB Developers Network
spacer