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)

Jolten 09-28-2004 12:50 AM

Unfortunately, this will also strip white space when editing posts. That's NOT good.

buro9 09-28-2004 01:33 PM

Quote:

Originally Posted by Jolten
Unfortunately, this will also strip white space when editing posts. That's NOT good.

This is indeed true.

However the basic non-aggressive one will one strip excess space between ">" and "<".

Unless you have HTML in your posts this shouldn't matter.

Does this impact anything? Such as the WYSIWYG editor? I've been running it for a little while on my site and I haven't noticed any detrimental effects when editing posts.

If you can give a detailed example I'll have a look and see what can be done about it.

My site runs with a history of all edits (an edit log), so I can diff between changes to see how this effects it.

dethfire 09-28-2004 02:47 PM

this lowered my homepage size by 3kb, it's a quick hack so worth the small effot :)

Jolten 09-28-2004 03:41 PM

Essentially it strips all returns out of posts when editing. In general, it's not a big issue but for long posts it's a little tiresome to have to go insert returns again. I did have the more aggressive version installed. I'll try the lesser one and see if that helps a little.

Paul M 09-28-2004 04:04 PM

Quote:

Originally Posted by Jolten
Essentially it strips all returns out of posts when editing. In general, it's not a big issue but for long posts it's a little tiresome to have to go insert returns again. I did have the more aggressive version installed. I'll try the lesser one and see if that helps a little.

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.

... :)

HuangA 09-28-2004 04:28 PM

This hack have a good concept; but it is not the best way to preserve bandwidth...

For example; if your site is not webmaster oriented, your members will be unlikely to post as much HTML/other contents that needs trimming, thus it wouldn't affect your site as much. If your site is webmaster oriented, you will want to preserve the code the way it is (for demonstration and code representation purpose). The members will have a hard time trying to learn:
Code:

<?
        if ( !$happy ) {
                print $sad_string;
        }
?>

if they don't know php and all they see is
Code:

<? if (!$happy){print $sad_string;}?>

And that's only a basic example, think what chaos it'd do with stuff like:
Code:

if (!$a):$b or die(print($c))
is presented to a newbie?

buro9 09-28-2004 07:43 PM

Oh absolutely.

But bandwidth preservation wasn't the #1 priority... delivery to the rendering engine and reduction of work for the rendering engine was.

If you have a site that is going to use CODE tags, etc... then use the now defaulted 'lite' version.

For those of you who do not post code, etc in CODE tags, and care not for <pre> tags... then the aggressive version will suit your needs and save a few more spaces.

buro9 09-28-2004 07:45 PM

And if you want to save bandwidth:
* Turn on GZIP
* Remove images where you consider them excess
* look at removing any redundent tags in the templates... you optimise the HTML ;)

Etc.

Removing a few images will do more than this does... but this will help it display faster ;)

Mickie D 09-29-2004 10:46 AM

for those having problems with the edit posts and new threads posts, PMS etc etc i have made this little addition that will switch to the light version if you view them pages (i think it works lol)

PHP Code:

    $thisscriptis = array(
        
'editpost',
        
'register',
        
'newreply',
        
'newthread',
        
'sendmessage'
    
);

    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);
    } 

thanks to mystic for the code fix i forgot to add


i wrote that out really quick so sorry if its not coded proppa but you get the idea ;)

h75 10-02-2004 03:46 AM

I clicked Install !!!!!!!!!!!!! terrific! :laugh: :banana:


All times are GMT. The time now is 10: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.01311 seconds
  • Memory Usage 1,747KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)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