|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
What :: UBB Compression with cgi_buffer.pm Version :: 6.1.0 PB 2 Info :: As promised in the recent U-zine article. Now you can dramatically reduce bandwidth and download times with an easy to use perl module. Demo :: https://www.ubbdev.com/ubbcgi/ultimatebb.cgi Credits :: WiLD for pointing it out to us Files :: https://www.ubbdev.com/hacks/6.1/Compress.zip How To :: Open ultimatebb.cgi, uncomment use strict; and use vars etc etc (lines #30 and #35) and add this: require Modules::Compress::cgi_buffer; import Compress::cgi_buffer $cgi_buffer::generate_etag = 0;
immediately before your use strict; so that it looks like this: require Modules::Compress::cgi_buffer; import Compress::cgi_buffer $cgi_buffer::generate_etag = 0; use strict; 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...  [ 09-16-2001: Message edited by: AllenAyres ]
|
|
|
|
Joined: Sep 2000
Posts: 4,211
Master Hacker
|
Master Hacker
Joined: Sep 2000
Posts: 4,211 |
Runs so much faster over here. 
|
|
|
|
Joined: Jan 2001
Posts: 1,940
Developer
|
Developer
Joined: Jan 2001
Posts: 1,940 |
Warning it requires Compress::Zlib which is not installed by default on most Perl-capable hosts.
q
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
As stated in the article All recent versions of activestate perl come with it... and if you are able to install this perl module on your server, you should be able to install the other required modules from cpan 
|
|
|
|
Joined: May 2001
Posts: 6,708
Member
|
Member
Joined: May 2001
Posts: 6,708 |
Sounds like one good mod. I'll give it a try soon. 
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
is this better than mod_gzip?
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
I believe they both use Compress::Zlib - performance should be comparable. I have never checked out mod_gzip because it's written for apache and I've never used an apache server.
WiLD is doing some performance testing and said he would report back his results.
ISAPI compression on a windows server is supposed to perform better than both, but takes a little more work to set up for dynamic files. We're using it for the static files here.
|
|
|
|
Joined: Jan 2001
Posts: 1,940
Developer
|
Developer
Joined: Jan 2001
Posts: 1,940 |
Theoretically, it'll be the same but mod_gzip allows more tweaking (in terms of compression); this module does not (if it uses Compress::Zlib's default gzip mechanism, compression is set at 4 iirc; 1 would be best for speed purposes and CPU load).
Anyways, if you already have mod_gzip on your server and it's compressing CGI output, don't bother to install this hack; it'll just waste CPU clicks.
q
[ September 07, 2001: Message edited by: qasic ]
|
|
|
|
Joined: Jun 2001
Posts: 94
Member
|
Member
Joined: Jun 2001
Posts: 94 |
wow Allen this is awesome w/o cgi_buffer.pm one thread with 2 replies generates ~17KB with cgi_buffer.pm this same thread generates only ~3KB thank you very much for this one Allen rated 
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
I really want to use this but each time i download cgi_buffer-0.3.tgz , it opens in winzip saying corrupt error. Am i looking at the right download here? 
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
I had the same problem... the download is trying to save it as a .tar file... be sure and save it as a .tgz file when you save it in the download. Winzip will then open it properly into a tar file and then unpack it after you've saved it to your computer.
Just a reminder this is for servers tht you are able to install perl modules on, either a dedicated server or a shared one a host doesn't mind installing perl modules for you.
|
|
|
|
Joined: Jan 2001
Posts: 1,940
Developer
|
Developer
Joined: Jan 2001
Posts: 1,940 |
Actually, just rename the file so it ends in .tar.gz and you'll have no problems.
qasic
|
|
|
|
Joined: May 2001
Posts: 1,042 Likes: 7
Moderator
|
Moderator
Joined: May 2001
Posts: 1,042 Likes: 7 |
n/m problem fixed. Dang! Pretty fast!
[ September 07, 2001: Message edited by: raiyan ]
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Where can I get THIS file? 
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
That's one of the modules mentioned that's required for using this. If you are using activestate perl, it's included. If not, I believe you can get all the modules from cpan.org
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
I'm using ActiveState Perl and it's not included here I got some versions from there, but they aren't IO::String (like Convertor::Ethiopian::String, Brute::String)
|
|
|
|
Joined: Jun 2001
Posts: 94
Member
|
Member
Joined: Jun 2001
Posts: 94 |
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Nevermind, fixed it, thanks hmiguelito Allen, I just found the source to the JavaScript problems: this hack  [ September 08, 2001: Message edited by: LK ]
|
|
|
|
Joined: Jan 2000
Posts: 5,073
Admin Emeritus
|
Admin Emeritus
Joined: Jan 2000
Posts: 5,073 |
gzipped Javascript and CSS cause some browsers to behave poorly. Known issue... smash the vendors upside the head.
UBB.classic: Love it or hate it, it was mine.
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
hmmmm... it seems to be compressing all the pages except the forum summary, as they are all 5-10kb except the forum summary which is ~68kb.
|
|
|
|
Joined: Jun 2001
Posts: 94
Member
|
Member
Joined: Jun 2001
Posts: 94 |
yes me too all except ultimatebb.cgi 
|
|
|
|
Joined: Apr 2001
Posts: 4
Junior Member
|
Junior Member
Joined: Apr 2001
Posts: 4 |
Here's an idea for anyone who wants to try it and doesn't have root access to the server to install it. You can create a directory in your 'Modules' directory called (lets just say) 'CGIBuffer' then copy the cgi_buffer.pm into that directory. You can then use this code to use the cgi_buffer module: I have not tested if it is actually compressing yet but there does seem to be an increase in speed when that code is used. Let me know if it does not work and I will remove my post. Thanks, GewGaw [ September 08, 2001: Message edited by: GewGaw ]
|
|
|
|
Joined: Apr 2001
Posts: 4
Junior Member
|
Junior Member
Joined: Apr 2001
Posts: 4 |
That is very correct qasic! I tested the situation on two separate virtual hosting accounts with two separate ISPs and it functioned fine. This would conclude that the two ISPs were running the required modules. Thanks for pointing it out... something I overlooked to mention. GewGaw
|
|
|
|
Joined: Jun 2001
Posts: 94
Member
|
Member
Joined: Jun 2001
Posts: 94 |
so Allen why isnt forum front page being zipped?
|
|
|
|
Joined: Apr 2001
Posts: 36
Member
|
Member
Joined: Apr 2001
Posts: 36 |
Could this also work on UBB 6.05? Cause I hate upgrading especially after applying like 40 hacks..  And upgrading to UBB 6.1 is a too big leap for me. Grtz., Michael
|
|
|
|
Joined: Jan 2001
Posts: 1,940
Developer
|
Developer
Joined: Jan 2001
Posts: 1,940 |
In theory, it should work as long as you have the required modules installed.
|
|
|
|
Joined: Apr 2001
Posts: 36
Member
|
Member
Joined: Apr 2001
Posts: 36 |
Thanks for the answer.. So it would save bandwith? Even on a 6.05 board (ofcourse) with the right modules installed? 
|
|
|
|
Joined: Jan 2001
Posts: 1,940
Developer
|
Developer
Joined: Jan 2001
Posts: 1,940 |
|
|
|
|
Joined: Jul 2001
Posts: 1,111
Member
|
Member
Joined: Jul 2001
Posts: 1,111 |
testing it on my 6.05 tonight  wish me luck [ September 09, 2001: Message edited by: Anime-loo ]
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
It should work on the 6.0x series, the problem might come in the coding of that series.. 6.1x code has been cleaned up tremendously and uncommenting the use strict; is no biggie. That would be my only concern. 
|
|
|
|
Joined: Jul 2001
Posts: 1,111
Member
|
Member
Joined: Jul 2001
Posts: 1,111 |
 thanks for the input ^_^, we just decided to wait till next weekend to try it on the main forums tho were ganna put it on are test forums tonight and see how it works out
|
|
|
|
Joined: Aug 2001
Posts: 94
Member
|
Member
Joined: Aug 2001
Posts: 94 |
hi have added this cant tell if it has worked would i get an error if it dont work ??? i dont have access to perl, im using a test board with a free host (F2S) because im shopping around for hosting 
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
You should get an error if the required modules aren't installed. Right click on one of your thread pages with a few replies and see if it is ridiculously small in the 5-10kb range 
|
|
|
|
Joined: Aug 2001
Posts: 94
Member
|
Member
Joined: Aug 2001
Posts: 94 |
yeah got in touch with f2s to see if they support it and they do wow its so zippy does it save bandwidth aswell GREAT JOB GUYS 
|
|
|
|
Joined: Sep 2001
Posts: 2
Junior Member
|
Junior Member
Joined: Sep 2001
Posts: 2 |
Wow , never thougt my hints would make it into THE UBBDEV-Zone  Hope that this helps many Board-Admins and Users as well. At least, I love this hack @all: As somebody said, all pages are compressed, except the forum-overview. I dont have any Idea why this happens. Did someone find out why this might happen? Willi
|
|
|
|
Joined: Mar 2000
Posts: 21,079 Likes: 3
I type Like navaho
|
I type Like navaho
Joined: Mar 2000
Posts: 21,079 Likes: 3 |
Haven't found out yet.. but it makes a huge difference elsewhere  Thanks for the pointers as well. I wrote to the author to see if he might still be developing this further, haven't heard anything yet. The next version of this will be developed to where it can be used on most any server - shared or dedicated... warnings will be issued tho regarding using this on a shared server and cpu usage.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|