Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 11

CurtisOdendoncsaulericgillettex00 +7 guests

Low-Cal Vanilla

This discussion is related to the Low-Cal Vanilla addon.
Low-Cal Vanilla
«1345

Comments

  • Posts: 223
    This worked well. So far no issues. Thanks for the release!
  • Posts: 183
    Oh wow, gonna give this a go!

    edit: No issues so far, think the pages are loading faster.
  • Uploaded version 0.1.1 of Low-Cal Vanilla.
  • Posts: 110
    as i understand it using gzencode would be a lot faster than using capture !?
  • Pretty cool... Nothing wrong yet. And it does seem they are loading a little faster. Hard to tell on a broadband connection.
  • Posts: 1,880
    @AlexL: capture?!
  • Posts: 2,419
    Wow ... wow!
    How does this work?
    Absolutely incredible, it's like I've doubled the speed of my broadband connection!
    I hope it's not a coincidence!

    Posted: Sunday, 26 August 2007 at 12:56PM

  • VazVaz
    Posts: 292
    Seems to be working great. My page has speeded up 1second. I should have added some page loading time code and tested it out!.. lazy me
  • Posts: 110
    @Dinoboff
    you are using the ob_get_contents, ob_end_flush and so on commands, they are *really* slow

    try something likeif(strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
    /* header stuff? don't know right now, sry */
    echo gzencode($content);
    } else
    echo $content;

    you can use microtime(true); to compare times.
    The function returns milliseconds (as float), so run it before and after the block, substract the times and compare to gzencode
  • Posts: 1,880
    I just tried with the following code:

    class LowCalVanilla extends Control {

    function Render() {
    $t1 = microtime(true);
    // This is only defined if gunzip extension is installed
    if ( defined('FORCE_GZIP')
    && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false
    ) {
    // Get the content of the page
    $content = ob_get_contents();
    ob_clean();
    echo gzencode($content);
    header('Vary: Accept-Encoding');
    header('Content-Encoding: gzip');
    header('Content-Length: ' . ob_get_length());
    $t2 = microtime(true);
    $t = $t2 - $t1;
    header('Time: ' . $t);
    }
    }

    function LowCalVanilla(&$Context) {
    $this->Name = 'LowCalVanilla';
    $this->Control($Context);
    }
    }

    And the result is similar.

    Update:

    New version:
    Time=0.000478029251099
    Time=0.000461101531982
    Time=0.000349044799805
    Time=0.000463962554932
    Time=0.000473976135254

    Previous:
    Time=0.000494003295898
    Time=0.000475883483887
    Time=0.000339984893799
    Time=0.000487089157104
    Time=0.000330924987793

    Server=Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.3
    Windows vista Intel Core 2 6600 @ 2.40 GHz; 2GB of RAM
  • Posts: 2,610
    Here's a little analysis...
     Mean% ImprovementMedian% Improvement
    Old0.0004255770.000425577
    New0.000445223-4.410.0004639632.57
  • Posts: 110
    mh thats far far less than I expected, sorry for the extra work but the ob_ functions actually being faster is just impossible. I guess both are just too fast for a good measurement ( < 0,5 ms ) the extra headers shouldn't be neccassary anymore? either way they go before echo ;) @stash nice one, but I'm not quite sure what your 3rd columt is?
  • Posts: 2,610
    Oops, cut 'n paste error. It was meant to say Median not Mean again. Edited and corrected.
  • Posts: 421
    If a server's already set up to use mod_gzip, then the addon isn't necessary, right?
  • Posts: 110
    not sure... is the server or just php set up to du so?
  • Posts: 2,419
    I am still stunned by the speed bump due to this add-on.
    Why isn't whatever it does on by default?
    Even Mac Firefox is actually fast with this!
    As AlexL asks, is this a server thing or a PHP setting?

    Posted: Thursday, 30 August 2007 at 2:00PM

  • Posts: 1,880
    Like dan said, the server can compress your output. But on a share hosting you won't have access to these settings and it will be turned off.
    For this addon, it's php who compress the output. You need to have the zlib php extension installed. The addon check it is installed.
  • Posts: 110
    oh yeah sry, I was thinking of css and js files. if you have php set to compress output (php.ini) you do NOT need this addon [ @Dinoboff maybe add a check? so output won't be compressed twice ] css and js files are not compressed by this addon. there is still quite some optimization possible
  • Posts: 1,880
    I forgot php can compress by default... I will add a check.
    You should always check your pages are not already encoded before installing the add-on:
    eg, use the Web Developer toolbar and check for "Content-Encoding: gzip" for the response header (Web Developer > Information > View response header) and the pages size (Web Developer > Information > View Document Size - check if it gives you a compressed size and an uncompressed size for the document).

    There is also these problem with some versions of IE:
  • Posts: 1,290
    the user-agent header

    $_SERVER['HTTP_USER_AGENT']

    http://www.zytrax.com/tech/web/browser_ids.htm#msie
  • Posts: 1,880
    umm... So I can sniff for IE5.5 or IE6 but I can't know which Service Pack they use.
  • Posts: 1,290
    SP2 browsers have "SV1" in the user agent string.

    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; [...]
  • Nice stuff :)

    It seems to work fine, however I get this error with People.
  • Posts: 1,880
    Which extensions are you using? As far as I know Vanilla doesn't use URL rewriter.
  • Here are my installed extensions:

    Account Picture
    Applicant Discovery
    Attachments
    Audioscrobblerizer
    Better BBCode
    Blog
    Buy A Drink
    Category Icons
    CategoryRoles
    Comment Links
    Discussion filters
    Discussion Tags
    Discussion View Count
    FCKAjaxQuote
    FCKEditor
    FeedPublisher
    Forum Statistics
    Google Anaytics
    Guest Welcome Message
    MassMailer
    Multi File Upload
    New Applicants
    Next Unread Discussion
    Nuggets
    Panel Re-Order
    Participated Threads
    PreviewBubble
    Preview Post
    Quick Whisper
    RandomQuotes
    Role History
    Saved Searches
    Textile
    Thankful People
    User Tasks
    Vanillazilla
    Whisper Notification
    Who's online
    Windows Links
  • Uploaded version 0.2.0 of Low-Cal Vanilla.
  • Posts: 1,880
    It doesn't compress the pages for IE5.5 and 6.0 (except sp2), using preg_match('/MSIE (5\.5|6\.0(?!.*\bSV1\b))/i', $_SERVER['HTTP_USER_AGENT']) to sniff them.
  • Posts: 926
    I just had to chime in and say I love the name.
  • Uploaded version 0.2.1 of Low-Cal Vanilla.
  • Posts: 1,880
    IE5.5sp2, IE6 and IEsp1 (it has nothing to do with windows service pack, my mistake, there is no ie6sp2) will always cache gzip content and IE6sp1 might lose the first 2,048 bytes of gzip content on some configuration (e.g.: if Real Player Basic is installed).
    There are patches for these bugs but you can't know if they are installed or not.

    With the last update, the pages won't compressed for any version of ie5.5 and ie6.
Sign In or Register to comment.