vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Board Optimization - Page Output Compression - Whitespace stripper. (https://vborg.vbsupport.ru/showthread.php?t=69787)

Gutspiller 11-02-2004 04:51 PM

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?

buro9 11-02-2004 06:44 PM

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.

Erwin 11-03-2004 03:50 AM

I've installed this and it seems to work well. Good idea.

Natch 11-04-2004 12:40 AM

^ ^ ^ The ultimate test ;)

h75 11-06-2004 05:06 AM

I had this modification enhanced. Because I work on calendar :rolleyes:

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


Mijae 11-09-2004 08:09 PM

Works for me!

I turned gzip to 1, applied this hack, and my forums are loading so fast I cant believe it.

MickDoneDee 11-17-2004 09:59 PM

*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

MickDoneDee 11-18-2004 10:17 AM

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?

buro9 11-19-2004 12:15 PM

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?

MickDoneDee 11-19-2004 12:57 PM

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?


All times are GMT. The time now is 06: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.01464 seconds
  • Memory Usage 1,743KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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