vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   RealTime Template Compressor: Reduces page sizes, loads pages faster, saves Bandwidth (https://vborg.vbsupport.ru/showthread.php?t=56589)

Dan_UPC 10-06-2003 12:40 PM

Quote:

Originally Posted by Erwin
I uninstalled this hack in the end at my private forums, basically because some members using IE for some reason got really wide threads. Don't ask me why. :)

I've also found and documented this.

Dan_UPC 10-07-2003 06:38 AM

With GZIP enabled, this hack is almost redundant ... the savings equate to about 1% or so over and above a GZIPPED page. The reported savings on a GZIP Enabled board are also bogus because it reports the size difference before being put thru GZIP.

Logician 10-07-2003 07:32 AM

Quote:

Originally Posted by Dan_UPC
With GZIP enabled, this hack is almost redundant ... the savings equate to about 1% or so over and above a GZIPPED page. The reported savings on a GZIP Enabled board are also bogus because it reports the size difference before being put thru GZIP.

The hack is effective even with GZIP enabled. The hack is removing certain characters from your source code so making it smaller in size. Since your hacked page's source code is now smaller, the gzipped outcome of it will be smaller then the gzipped outcome of unhacked page. The hack is using completely a different algorithm than GZIP to save bandwidth so you can not say it is redundant with GZIP.

If you ZIPed a Microsoft Word document, would it be redundant to remove a few pages of the original document just because you ZIPed? If you remove some pages before the compression, the ZIPed outcome will become smaller, it is simple aritmetic.

But you don't agree, please uninstall it. It is not mandatory to use it..

Dan_UPC 10-07-2003 10:28 AM

Logician,

I'm not saying that it is 100% redundant but it makes very little difference if you've got gzip turned on ... I tested with gzip on with and without this and the difference is extremely small. It also has bugs that make it a big pain to use on some pages. I'm not complaining, just trying to give a bit of constructive criticism as with a bit of tweaking I can see this being of use to some people.

Erwin 10-07-2003 11:18 AM

I still can't explain why some threads become wide. Any ideas? The only one I can think of is carriage breaks caused by spaces in HTML are removed.

Dan_UPC 10-07-2003 11:25 AM

Quote:

Originally Posted by Erwin
I still can't explain why some threads become wide. Any ideas? The only one I can think of is carriage breaks caused by spaces in HTML are removed.

I'm investigating it at the moment ... should have an answer for you by the end of the week.

Logician 10-07-2003 01:39 PM

Quote:

Originally Posted by Erwin
I still can't explain why some threads become wide. Any ideas? The only one I can think of is carriage breaks caused by spaces in HTML are removed.

Erwin, I guess it should be possible to find the cause when you check the source code of such threads with and without the hack.

I'm not able to track/debug it because I have never experienced such a problem in the boards I have installed the hack. The only display problem I witnessed and reported in the FAQ is the page split links getting closer to eachother.

Logician 10-07-2003 01:44 PM

BTW. please note I have never tested it in VB3 which may be the reason of your problem..

Dan_UPC 10-07-2003 02:28 PM

Ok, I've worked out what was causing the really wide tables in my case. I'll post a fix in the next 48hrs.

Red Blaze 10-07-2003 05:10 PM

whoa! Damn it does load faster! =o

Thanks for the hack. ^__^

Erwin 10-08-2003 10:01 AM

Quote:

Originally Posted by Logician
Erwin, I guess it should be possible to find the cause when you check the source code of such threads with and without the hack.

I'm not able to track/debug it because I have never experienced such a problem in the boards I have installed the hack. The only display problem I witnessed and reported in the FAQ is the page split links getting closer to eachother.

Yeah, I tried doing this but couldn't figure it out. :)

Princeton 10-20-2003 02:27 AM

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 ....

Logician 10-20-2003 09:34 AM

Quote:

Originally Posted by princeton
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 ....

Thanks for sharing the info. I haven't tested it yet but from the apperance it looks like it can be the cure for guys who are having visual problems. So after I tested it, I plan to add it to the hack code and make it user selectable inside the code so that everybody can select the compression method as they like.

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?).. :)

Princeton 10-20-2003 01:43 PM

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:

it is also weird the original source sizes are different in your each screenshots (as if they belong to different pages?).
hmm ... I have to re-check.

I must have minimized a block ... new screenshots attached.

MaDCaT75 10-30-2003 05:43 AM

I dont like the way this shrinks the page numbers in the thread list I.E. 1234 instead of 1 2 3 4

Rampag33 10-30-2003 06:33 AM

*** Installed ***

Thanks reloaded the first page and already see how much was saved, Thanks. Simple yet very very effective.

magnus 11-05-2003 02:07 PM

Quote:

Originally Posted by princeton
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 ....

Excellent! This fixed the spacing, plus increased compression. Thanks, princeton!

Princeton 11-05-2003 03:04 PM

Quote:

Originally Posted by magnus
Excellent! This fixed the spacing, plus increased compression. Thanks, princeton!

To implement this on your site you should remove all comments found within javascripts embedded in your templates. If you do not remove ... you will receive errors in pages with javascript embedded. For example, wywsiwyg editor will not function as it should.

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?

dstruct2k 12-31-2003 06:14 AM

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.

Logician 12-31-2003 08:56 AM

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.

Princeton 12-31-2003 03:01 PM

In vB3, you have more control of Search and Replace.
It's only a headache if you don't know how to use it properly. (It takes some time to get use to it.)

In vB3, you'll find that it has a lot of javascript/comments and "empty" space (found in rendered html source) caused by conditionals. Remove all these space/lines/comments and your site will load quicker and save on bandwidth.

- every little bit counts

EricGT 02-28-2004 10:10 PM

Quote:

Originally Posted by Crinos
There are a lot more "spacing" issues then the ones mentioned above ... the "down arrow" button marking new posts also loses its spacing in forumdisplay ... the postbit buttons all become cramped together in some areas ... forum text links separated by white space all get smashed together, etc ...

I am giving this hack a chance, I really am, by hunting all templates in my test forum that contain visible white space and grumpily replacing them with &nbsp; ... just incorporating the hack isn't enough if you like your page to not look amateurish with all the lost white space...

Even the slightest misalignment makes me cringe, what more for squished links :D

It seems to me that there is a pretty simple way to deal with this spacing issue. In the preg_replace statement, instead of eliminating all white-space characters between html tags, replace all white-space characters between html tags with one space. The addition to the file size would be minimal and this would deal with the spacing problem. This is what I did on my site and it is working great.

Thanks for a very helpful hack. My site is using 80 - 90% of two T-1's and a 5% or 6% reduction is bandwidth is meaningful. Eric

Bulent Tekcan 03-07-2004 09:40 AM

Sorry

Is it available VB3 RC4 ?

Thanks

Logician 03-07-2004 10:25 AM

Quote:

Originally Posted by turkeyforum
Is it available VB3 RC4 ?

I don't use VB3 so not yet.. But will be..

Rampag33 04-20-2004 11:30 PM

How do you implement this in VB3 gold?

jthorpe 12-02-2004 10:38 AM

Welp, this screwed up my board a good bit so I removed it, and now many of my templates have added spaces when they didn't before. So now I have to spend a number of hours going back to fix them. On top of that, my CMPS templates have screwed up colors in IE now. Since I'm running Gzip, I don't see the benefit. I guess I should have realized that before installing this hack.

Logician 12-02-2004 07:00 PM

Quote:

Originally Posted by jthorpe
Welp, this screwed up my board a good bit so I removed it, and now many of my templates have added spaces when they didn't before. So now I have to spend a number of hours going back to fix them. On top of that, my CMPS templates have screwed up colors in IE now. Since I'm running Gzip, I don't see the benefit. I guess I should have realized that before installing this hack.

The version I released in the first post of this thread can not cause such effects if you managed to install it successfully. For starters its compression is in "real time" (ie on the fly) so no templates are actually changed. Hence it is impossible that templates have added spaces even after the removal of the hack.

jthorpe 12-02-2004 07:20 PM

hmmm, interesting. It wasn't happening before the hack, and everything is still screwed up after removing it. I haven't missed anything on the install or removal so I know the hack is completely gone, yet some of my formatting is still messed up. It has obviously done SOMETHING to my forum. Whatever that is yet, I have yet to discover. I'm not sure if mmcache could be having an issue or not but when I put the hack back, the stuff that's screwed up now goes back to normal, and of course I lose spaces all over the place on the other stuff. Don't know what to tell ya, but the hack did cause this problem.

alqadir 12-18-2004 09:34 AM

This question might not belong here, so if it does not please remove it.
Let's say I wanted to remove empty excessive white space. So in the code if you see <br /> <br /> <br /> (ie <br /> three times in a row) how would you remove it so that you can have a max of two in a row.

I need this because, everytime the editor edits an html marked up post, at the end of each line it adds <br /> making the post huge if edited a few times


All times are GMT. The time now is 01:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01483 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (29)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete