The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth Details »» | |||||||||||||||||||||||||||
RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth
Developer Last Online: Nov 2023
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
|
Comments |
#2
|
||||
|
||||
Screenshot:
(Please note: This line will be visible ONLY if you already have your Microstat's hack installed in your server! If you dont have microstats hack, template compressor hack will STILL work and make the same compression, but you will just don't notice this line in your vb pages) |
#3
|
||||
|
||||
1- How does this hack work?
It removes unnecessary spaces/line break characters from your templates before they are displayed so reduces the size of page output in ALL vb pages. Every space and line break chars between HTML tags takes 1 byte size in your pages so by removing them page sizes become smaller, pages load faster and you save bandwidth. 2- Can you give a live example? Say any of your vb templates has this content: PHP Code:
However if you wrote the HTML code like this: PHP Code:
This is what this hack does. It does NOT change/modify the source code of your templates, but it compress them in realtime whenever they are displayed by a site visitor and make them as if they had written with no spaces and line breaks. 3- But if you remove spaces/line breaks, isn't the display ruined? Are there any downsides of this hack? The hack does not remove the spaces and line breaks in your own wordings, it just removes them when they are between html tags which are technically useless and unneeded. These spaces are there in the first place so as to make the source code more readable for the developer. But they are actually redundant and eating bandwidth by increasing page size everytime that page is displayed. I tested the hack extensively in many boards and I can say that it does not bother the display or create any other problems. The only tiny problem I run into is the thread/forum split page links (< [1] 2 3 4 >) getting closer to eachother after hack's installation. No other problems reported. On the other hands if you have custom javascript codes in your templates, I'm not sure how they can be affected. Default vbulletin javascripts in templates works fine. Also I dont know how the hack is doing with very old or obselete/non-standart browsers. Tested in IE, Netscape and Mozilla and all is fine. Also if you encounter a display problem in a vb page, first make sure your HTML syntax is correct in your relevant templates that form that page. The hack can be confused in templates where HTML tags are used incorrectly (eg. missing > or < chars etc.). This might happen if you manually customized some templates and used untidy/wrong HTML tags. 4- How much bandwidth is saved with this hack? It depends. The reduced kilobytes change from page to page because in every page number of removed chars can be different. Also it changes from board to board because how much your templates are cluttered can be different than other boards too, especially if you customized them. If you have many blank lines, inlined design, long spaces between your HTML tags inside your templates, the save will be more. If your templates are already compact, the save will be less. But to give an estimate I can say that in my tests the hack saved averagely %2 to %5 bandwidth in many boards. If you have Microstats hack installed, you can see how much bandwidth is saved in every vbulletin page while you browse them. You can read the thread to see users' experience too. Eg. here or here. Also please feel free to share your experience if you have microstats installed and see the gain in your footer. 5- I already have GZIP enabled in my server. How does it go along with this hack? Can I still use this hack? They can work together and the hack still saves bandwidth even if you have GZIP installed. This is because their compression works differently so having GZIP alone is not sufficent for the compression this hack is doing. 6- I installed the hack but nothing happened?!? I can not see the saved bandwidth line your screenshot displays? Is the hack working? How can I see how much bandwidth is saved? That line is visible only if you have Teck's Microstats hack installed. If you don't have that hack, template compression hack will still work perfectly and saves bandwidth but you just can not see how much bandwidth you save. In this scenario you won't even notice whether hack is installed or not. To see that line (it is for admin view only), first install Microstats hack and secondly apply the install instructions of this hack which is for the boards that has microstats hack. 7- Do I need Microstats hack to install this hack? No you don't. This hack will work whether you have Microstats hack or not. But if you have it, you can see how much compression is made by this hack in all vb pages. If you don't have Microstats, then same compression will be performed but you won't know about its stats anymore. 8- What if I go through all templates and remove spaces/new lines manually? Yes you can and at the end you will have the same bandwidth save in your board that this hack does. But: a) It is way a lot of work! There are hundreds of templates you need to edit. b) It makes your source code hard to read if you later want to change something there as an admin. On the other hand this hack does not touch your source code and it is still readable when you want to edit it, but it just compress it in realtime (only at the moment it is displayed to the user.) 9- After hack is applied, my source code becomes very hard to read! All spaces and new lines are gone! So isn't this what this hack is suppose to do anyway . Also please note that this is so ONLY IF you check the source code in "view source" link of your browser after page is loaded. Your source is still readable and untouched in your edit template pages which is where you access/update them as an admin. So what matters if users can not get a readable source code? It is better cause it is now harder for them to rip it. 10- I have a display problem about ......... with this hack? Can you fix it? No I can't because it is not possible. Just uninstall it. As the hack intends to remove such chars, it is not possible to fix the hack if this removal creates an unexpected problem. (Although no such problems have been experienced with this hack yet, I'm mentioning just in case) 11- Can you put a setting to turn the hack's compression ON and OFF in admin CP/options page. It can be done but I won't do it, my apologies. Such a change will not add a feature that will make the hack work better or more functional but it is just for make up. I prefer to keep hacks as simple as possible so that they can be easily installed by even newbiews. The hack as it is just 1 step and a few lines of change at the moment which is very easy to install for anyone. I don't want to make the installation sophisticated to add a make up change. If someone feels to add this change, he is welcome to share it here with other hack users. 12- Why didnt you code the hack to remove "HTML comment lines" from templates too? You would save more bandwidth. Right but at the moment hack's core (the line which makes the removals) is 1 line only and to remove HTML comments I needed to add more lines which might slighly increase PHP time of the script. IMO the gain from HTML comment removal is not worth having these lines. Besides you can easily remove such comments manually from your templates via TEMPLATE SEARCH feature in your admin CP as they are not too many. 13- Does the hack add SQL queries? Nope, it does not. 14- Does the hack work in all vb versions? Tested in vb 2.3.0. Though should work in all 2.x.x. VB3 hacks are not allowed while VB3 is in beta stage so please do not ask for a VB3 version. |
#4
|
|||
|
|||
Very nice, im going to apply this to vB 3 . Great idea, and good documintation as always.
|
#6
|
|||
|
|||
check out webmasterplan.com
test your forums before and after installing it Before: Quote:
After: Quote:
Thank you |
#7
|
|||
|
|||
$versionnum=phpversion(); dont have this in my functions.php so can u give me a clue where im to add it as i have microstats already installed so unsure why i dont have that line.
|
#8
|
||||
|
||||
Quote:
Check around lines 500-600 in functions.php. |
#9
|
|||
|
|||
yeah was me bein dumb search never found it but i did
before - Page generated in 0.12308896 seconds (76.08% PHP - 23.92% MySQL) with 21 queries. [Debug Mode OFF] [PHP v4.3.2] [GZIP disabled] [Server Load: 0.46 ? 0.46 : 0.39] After this mini Hack Page generated in 0.10551906 seconds (73.14% PHP - 26.86% MySQL) with 21 queries. [Debug Mode OFF] [PHP v4.3.2] [GZIP disabled] [Output: 30.36 Kb. compressed to 28.65 Kb. by saving 1.71 Kb. (5.65%)] [Server Load: 0.73 ? 0.67 : 0.59] [high]* lasto clicked install[/high] |
#10
|
|||
|
|||
wow i like this one - ok logician i installed your other hack yesterday and made meself a template in admin cp using web templates now look at savings on this page.
Page generated in 0.09775603 seconds (81.29% PHP - 18.71% MySQL) with 12 queries. [Debug Mode OFF] [PHP v4.3.2] [GZIP disabled] [Output: 15.22 Kb. compressed to 9.82 Kb. by saving 5.40 Kb. (35.50%)] [Server Load: 0.40 » 0.50 : 0.53] |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|