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 |
#92
|
||||
|
||||
Quote:
|
#93
|
||||
|
||||
I added this to a project I'm currently working on ... and I think it's great.
I modified the expression ... $vartext = preg_replace ("'([\r\t\n])[\s]+'", "", $vartext); this has been tested only on a non-public vb3 forum it seems to compress more then the original (view attachment) and it doesn't remove the "space" between the .... |
#94
|
||||
|
||||
Quote:
But I'm confused how come it compresses more than my line as your line seems to remove successive spaces and my line removes them all. BTW it is also weird the original source sizes are different in your each screenshots (as if they belong to different pages?).. |
#95
|
||||
|
||||
Currently, I have the compression as selectable by admin (in case of high server load).
I admit most of the compression is done in the <head> CSS section. (I'm using vb3.) Quote:
I must have minimized a block ... new screenshots attached. |
#96
|
|||
|
|||
I dont like the way this shrinks the page numbers in the thread list I.E. 1234 instead of 1 2 3 4
|
#97
|
||||
|
||||
*** Installed ***
Thanks reloaded the first page and already see how much was saved, Thanks. Simple yet very very effective. |
#98
|
||||
|
||||
Quote:
|
#99
|
||||
|
||||
Quote:
To do this go into your ADMIN PANEL and do a search and replace for Search for text: <script type="text/javascript"> <!-- Replace with Text: <script type="text/javascript"> Search for text: //--> </script> Replace with: </script> You can also do this for <style> but it is not necessary as <style> will work when compressed. If you think the comments are necessary think again ... Comments are used to hide code from version 1 and 2 browsers. How many users do you think will visit your site with a 1 or 2 browser? And, if so, the site will not work as it should because they will not be able to interpret the javascript. A condtional statement checking for browser version should be used to render or not render javascript. Why send javascript bytes that will not be utilized by browser? |
#100
|
||||
|
||||
Broke too much of my spacing, and I don't have enough time to redo it all right now. Awesome idea though, I had a 3.6% save.
Maybe I'll give this other compression method a try one day. |
#101
|
||||
|
||||
Unfortunately the compression method of princeton creates problems in javascripts as he mentioned above. I confirmed that it compress better and fixes spacing problem but I believe trying to fix all javascripts in all templates is an headache so I prefer to use my compression method. Your call which one you want to use but make sure you fix your javascripts in princeton's method otherwise some features of your board (eg. smilies) will stop.
Frankly speaking I don't see spacing as a problem. It neither interferes with how board functions (it is just visual) nor hard to fix. I dont know how it will do if you have skins or something but in a default vb, it just affects page numbers which is very easy to fix with a one template edit. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|