Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth Details »»
RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth
Version: 1.00, by Logician Logician is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-28-2003 Last Update: Never Installs: 78
 
No support by the author.

As you know all vbulletin pages consists of templates and templates consists of HTML (+sometimes javascript) tags.

Nearly in all sites and HTML pages, HTML tags are written in a readable format so that developer can read the source code easily. VB templates abide by this rule too.

However when this "nicely readable" code is called by a visitor, page size unnecessarily increases because of the redundant "spaces" and "line breaks" in the source code which have no useful purpose regarding the page output but is there just for making the source code more readable to the developer.

This hack removes these unnecessary spaces and line breaks from your vbulletin templates AT THE MOMENT they are displayed (in realtime). It does NOT touch your original source code so it is still readable to you when you want to edit it in your admin CP. But it compress the output when they are sent to user's browser.

Removal of these unnecessary characters makes sure:
a) Page output shrinks in all vb pages
b) Thus page loads faster by all visitors
c) You save bandwidth.

Since the removed characters are unnecessary characters, display of your page does NOT change. Please see FAQ below for more info.

This hack is 100% compatible with Teck's Microstat Hack and my Advanced Templates: Dynamic Templates Changing according to different conditions hack and WebTemplates 2.x: VB Integrated Content Management System . It is a very easy to install add (just a few lines in 1 step) yet effective.

I appreciate if you can click INSTALL button, if you use the hack. Thank you. :glasses:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 09-01-2003, 05:54 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician, I have to say it again - this is such a great idea! Absolutely minimal server overhead for a huge bandwidth saving! I use And such a simple concept, easily implemented, yet no one else thought of it. Pure genius.
Reply With Quote
  #43  
Old 09-01-2003, 06:52 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 09:54 AM Erwin said this in Post #41
Logician, I have to say it again - this is such a great idea! Absolutely minimal server overhead for a huge bandwidth saving! I use And such a simple concept, easily implemented, yet no one else thought of it. Pure genius.
Thank you pal.. Great you liked it!
Reply With Quote
  #44  
Old 09-01-2003, 09:42 AM
KuraFire's Avatar
KuraFire KuraFire is offline
 
Join Date: Oct 2001
Location: inside vB3's .php
Posts: 1,245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
08-30-03 at 10:40 AM Logician said this in Post #23
If you are using WebTemplates to manage your "normal pages", the answer is YES. Otherwise no..

Actually, this will just work for EVERY page that you output using vBulletin's doooutput function. That doesn't limit one to Webtemplates at all, most of my entire site is done using vB's dooutput function (and all of KFN 6 will be done using vB3's print_output() function), and as such this hack will apply to all those pages.

works fine in vB3 as well btw, I just placed the code (with tiny changes) in vB3's print_output function in the proper place, works like a charm. Dunno yet if I'm gonna keep it though, unformatted source code might be 'more difficult for people to rip', but usually people don't rip sourcecode, they learn from sourcecode. Lack of proper indenting also looks unprofessional...
Reply With Quote
  #45  
Old 09-01-2003, 10:44 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One side effect - this hack does remove spaces in between images in the output as well. No big deal, but the buttons in the postbit are cramped next to each other.
Reply With Quote
  #46  
Old 09-01-2003, 11:17 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 02:44 PM Erwin said this in Post #44
One side effect - this hack does remove spaces in between images in the output as well. No big deal, but the buttons in the postbit are cramped next to each other.
As a matter of fact all these minor side effects can be cured by using
PHP Code:
&nbsp
instead of spaces in the affected templates. It is a better syntax as far as HTML is concerned too.

Quote:
Actually, this will just work for EVERY page that you output using vBulletin's doooutput function. That doesn't limit one to Webtemplates at all, most of my entire site is done using vB's dooutput function (and all of KFN 6 will be done using vB3's print_output() function), and as such this hack will apply to all those pages.
That is right. The hack applies to all VB pages so if your regular pages are vb integrated too, you'll have the compression in them as well. But the question was whether the hack can be applied to regular (non-vb integrated) pages or not and the answer is no unless user uses a vb-integrated solution such as webtemplates.
Reply With Quote
  #47  
Old 09-01-2003, 12:37 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i noticed the buttons where all together and thought it was me

ok will fix with command above cheers
Reply With Quote
  #48  
Old 09-02-2003, 04:54 AM
StrykerContact StrykerContact is offline
 
Join Date: Feb 2003
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is great, I use to use this sort of thing to compress my html pages.
Reply With Quote
  #49  
Old 09-02-2003, 11:25 AM
Kriek's Avatar
Kriek Kriek is offline
 
Join Date: Jul 2002
Location: Florida
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent, though there seemed to be thousands of instances spanning thirteen styles/skins where I would need to replace relevant spaces with & nbsp;. So I decided to replay the backup functions file.
Reply With Quote
  #50  
Old 09-02-2003, 09:44 PM
Sebastian's Avatar
Sebastian Sebastian is offline
 
Join Date: Oct 2002
Location: America
Posts: 488
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician, this is a great hack. However, i will not use it because i am too picky and html must look readable

i know there are many people that like to view the page source, i myself do.

its just a habit by most coders to look at the page source.

you also have to note that 1byte is extremely small, 1,000 bytes is just about 1KB.

there really isn't much you'll be saving, as even a user on 56k would probably not even noticed a difference in 5,000 bytes.

you might save a dollar or two by doing this, but a lot of page source viewers are gonna be like "what a crappy coder"

lol

seriously though, good thought.
i am trying to focus my time in reducing vbulletin queries. that is what kills me.
Reply With Quote
  #51  
Old 09-03-2003, 06:30 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
09-01-03 at 10:17 PM Logician said this in Post #45
As a matter of fact all these minor side effects can be cured by using
PHP Code:
&nbsp
instead of spaces in the affected templates. It is a better syntax as far as HTML is concerned too.
True, except
PHP Code:
&nbsp
creates a wider space than a normal HTML whitespace. However, I still love your hack. 5% savings is equal to many many gigabytes for me per year.
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 11:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09220 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete