Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

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
  #62  
Old 11-02-2004, 04:51 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So if we use the lite version regular code that is edited during adding a new hack won't be affected and look different?

Is there a big difference between the lite and extreme versions as far as page loading speed is concerned?

Say, if I was interested in the fastest speed, maybe install all the hacks I ever wanted installed on my board and then as the very last hack run the extreme version of this that "compresses" all the code together, so the code looked like sheet, but at least they loaded fast?
Reply With Quote
  #63  
Old 11-02-2004, 06:44 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No difference to any hacks... all hacks will run prior to this (except microstats), and it is the final HTML for the whole page that has whitespace stripped.

I couldn't see a difference between the old lite and extreme versions on page rendering... I suspect it's just too small to be noticeable. The only difference between those two versions is how much whitespace is left in the page... you are fine to use the lite one without anything messing up, but some of us like being a little too anal and stripping as much as we safely can even when the difference is arguable... "if it doesn't cost anything, then do it" is my philosophy.

Yup, that last line describes what it does. But I've only this evening updated the hack (see the first post)... so there isn't a seperation between lite and extreme. It runs the and the extreme stuff where it can, and the lite stuff everywhere else.
Reply With Quote
  #64  
Old 11-03-2004, 03:50 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've installed this and it seems to work well. Good idea.
Reply With Quote
  #65  
Old 11-04-2004, 12:40 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ ^ ^ The ultimate test
Reply With Quote
  #66  
Old 11-06-2004, 05:06 AM
h75's Avatar
h75 h75 is offline
 
Join Date: Sep 2004
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had this modification enhanced. Because I work on calendar

Code:
// ###################### Page Output Compression #######################

	$thisscriptis = array(

	    'editpost',
	    'register',
	    'newreply',
	    'newthread',
	    'sendmessage',
	    'calendar',
	    'faq',
	    'profile',
	    'private',
	);

	if (!in_array(THIS_SCRIPT, $thisscriptis))
	{
    $patterns = array('/\>\s+\</', '/^\s*/m');
    $replace = array('> <', '');
    $vartext = preg_replace($patterns, $replace, $vartext);
	}
	else
	{
	    $vartext = preg_replace('/\>\s+\</', '> <', $vartext);
	}

// ###################### Page Output Compression #######################
Reply With Quote
  #67  
Old 11-09-2004, 08:09 PM
Mijae's Avatar
Mijae Mijae is offline
 
Join Date: Nov 2001
Location: Russia
Posts: 523
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works for me!

I turned gzip to 1, applied this hack, and my forums are loading so fast I cant believe it.
Reply With Quote
  #68  
Old 11-17-2004, 09:59 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*installed* Simple installation and great results.

I already had VB3 MicroStats installed so I added the code BEFORE:

$pageendtime = microtime();

Results:

Code:
Page generated in 0.13810205 with hack    0.32 : 0.24 : 0.19  index.php
Page generated in 0.13857198 without hack 0.15 : 0.29 : 0.23

Page generated in 0.23258996 with hack    0.23 : 0.23 : 0.18  England forumdisplay
Page generated in 0.23134303 without hack 0.55 : 0.31 : 0.22 

Page generated in 0.45348811 with hack    0.08 : 0.19 : 0.17  showthread - The 1981 Ashes series revisited
Page generated in 0.45551610 without hack 0.53 : 0.37 : 0.25
As you can see there's not a lot of difference in the speed that the pages are generated but there is a significant reduction in average server load.

I have a broadband connection and the increased download speed is only marginally apparent. According to Speedar my connection speed is approx. 104.2 kilobytes/sec.

I also did a gzip test which produced the following result for my homepage:

The webpage is COMPRESSED / GZIPPED!

>> Savings: 80%

Filesize: 55.6KB [11.2KB] html / text only
Reply With Quote
  #69  
Old 11-18-2004, 10:17 AM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I had to uninstall this because I need to use Code tags occasionally to display tables properly and this hack causes tables to display incorrectly. Pity a solution can't be found for this otherwise it is a great hack.

Is there a version that doesn't alter the spaces within Code, PHP and Pre tags?
Reply With Quote
  #70  
Old 11-19-2004, 12:15 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MickDoneDee
Is there a version that doesn't alter the spaces within Code, PHP and Pre tags?
No.

It could theorhetically be done, but the additional overhead in doing so would hurt you in performance.

I'd need to regexp for <pre> and </pre>, chop those out, perform the strip, and put those backin... string concats and chops of that size is far more intensive than simply the current regexp for the strip.

Would people really want a solution that was heavier on the processing?
Reply With Quote
  #71  
Old 11-19-2004, 12:57 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi buro9, I can live without the pre tags but I do need to use the code tags to display tables properly. Is that possible? Or does the code tags present the same problems as the pre tags?
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 08:25 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.04634 seconds
  • Memory Usage 2,310KB
  • Queries Executed 27 (?)
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
  • (2)bbcode_code
  • (1)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
  • (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_postinfo_query
  • fetch_postinfo
  • 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