Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard

Reply
 
Thread Tools
Page Output Compression - Whitespace stripper. Details »»
Page Output Compression - Whitespace stripper.
Version: 1.00, by buro9 buro9 is offline
Developer Last Online: Jul 2012 Show Printable Version Email this Page

Category: Board Optimization - Version: 3.0.6 Rating:
Released: 09-22-2004 Last Update: Never Installs: 70
 
No support by the author.

No longer supported by the author.

Show Your Support

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

Comments
  #12  
Old 09-25-2004, 11:47 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mrboz
wow - this makes every page load much faster

thanks very much, great hack.
Your site will be even quicker if you let vBulletin store your CSS as external files. Then they can cache in the browser and you send less with each page request
Reply With Quote
  #13  
Old 09-26-2004, 12:09 AM
turbidblue's Avatar
turbidblue turbidblue is offline
 
Join Date: Apr 2004
Location: Indiana
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by buro9
Your site will be even quicker if you let vBulletin store your CSS as external files. Then they can cache in the browser and you send less with each page request

how?

[high]* turbidblue is interested [/high]
Reply With Quote
  #14  
Old 09-26-2004, 12:31 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by turbidblue
how?

[high]* turbidblue is interested [/high]
Check your AdminCP options:

AdminCP > vBulletin Options > Style & Language Settings > Store CSS Stylesheets as Files? = Yes

Note that vBulletin needs to be able to write the files to the folder:
Quote:
If you would like to store the CSS stylesheet for each style as a file, you must ensure that you have a directory called 'vbulletin_css' inside the 'clientscript' folder, and that the web server has permission to write and delete files within that directory.
So you will need to create the directory is it doesn't exist, and then CHMOD the directory in question to have permissions something like 755 or 775 depending on how your Apache is configured. You don't want to CHMOD it 777... you never want to do that.

You can usually set permissions via FTP programs or SFTP... but it can always be done from SSH or Telnet
Reply With Quote
  #15  
Old 09-26-2004, 12:35 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by buro9
Check your AdminCP options:

AdminCP > vBulletin Options > Style & Language Settings > Store CSS Stylesheets as Files? = Yes

Note that vBulletin needs to be able to write the files to the folder:


So you will need to create the directory is it doesn't exist, and then CHMOD the directory in question to have permissions something like 755 or 775 depending on how your Apache is configured. You don't want to CHMOD it 777... you never want to do that.

You can usually set permissions via FTP programs or SFTP... but it can always be done from SSH or Telnet
And yes, I realise that 664 is probably a better chmod... but you know... some servers I've been on are just lovely and hardened and prevent writing withour very specific chmod values... 755 and 775 being the most common two... so I was being lazy in giving execute too as this prevents people bugging me about something unrelated to the hack
Reply With Quote
  #16  
Old 09-26-2004, 02:58 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The full version screws up nicely formatted posts when you edit them, so I have used the "lite" version which doesn't do this.
Reply With Quote
  #17  
Old 09-26-2004, 04:14 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
The full version screws up nicely formatted posts when you edit them, so I have used the "lite" version which doesn't do this.
Yes, I think I'll switch them around and suggest the lite version for all... and then those who want the aggressive version can opt for that if they wish.
Reply With Quote
  #18  
Old 09-27-2004, 06:29 AM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by buro9
On average I've been witnessing it strip about 8% of total page bytes from every generated page.

We all GZIP don't we? The benefits of this is that all gaps between HTML become the same pattern, and so they compress better for GZIP'ing.
David, can you show me examples of your findings? I generally don't believe that the compression ratio is that much affected by the mere presence of whitespace. But of course I could be wrong
Reply With Quote
  #19  
Old 09-27-2004, 07:57 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AlexanderT
David, can you show me examples of your findings? I generally don't believe that the compression ratio is that much affected by the mere presence of whitespace. But of course I could be wrong
Hehe, that was a nice challenge, but one I enjoyed.

To offer a proof I've done the following:
wget my forum index.php both compressed using the now default non-aggressive regexp, and also without this hack applied.

The sizes of the two files:
37,732 bytes = Compressed file
41,348 bytes = Uncompressed file

A 9% reduction in filesize.

I then ran gzip from within SSH, this should be the same as PHP gzip'ing them or a close approximation thereof:

6,748 bytes = Compressed + GZIP
8,102 bytes = Uncompressed + GZIP

A 20% reduction in final filesize.

The additional reduction of the size is higher than merely the white space being stripped and is an indicator that doing this does offer a benefit to GZIP.

So the compressed page (exactly the same HTML but without white space) ends up being 20% lighter with GZIP'ing than the non-compressed page.

Of course, the mileage varies on every page and with each style that you use. I should point out that the above was run against my current forum homepage which is not the default vBulletin style and that I've hacked my page quite a lot. So the filesize of your page and the amount it compresses and the amount it GZIPs are all factors depending on your configuration and the amount of whitespace in a page, etc.

The worst I've seen from this hack is a mere 3% reduction in file size on some of the smaller pages (such as the error messages).

The biggest benefit isn't the saved 1k of traffic... but the speed at which the rendering increases. Whether that is because the file transfered quicker, of the DHTML engine didn't have to work so hard ignoring whitespace, etc... I simply do not know... but it does appear to render faster and that is my prime goal
Reply With Quote
  #20  
Old 09-27-2004, 08:23 AM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Of course... all of the above is simply a bigger advert for turning on GZIP than using this hack

If anyone doesn't have GZIP turned on in their vBulletin... I suggest you do that first
Reply With Quote
  #21  
Old 09-27-2004, 02:22 PM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, convinced. Thanks
Reply With Quote
Reply

Thread Tools

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 04:08 PM.


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.14362 seconds
  • Memory Usage 2,309KB
  • 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
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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