• Im not sure if it made a difference cause its hard to tell on a shared server.

    In the db-functions.php file i changed the load function to:

    function load( $tag = ” ) {
    if ( $tag == ” ) {
    return false;
    }

    $file = $this->storage.”/”.$tag;

    $result = unserialize( file_get_contents( $file ) );

    return $result;
    }
    `
    on line 775 in db-module.php

    old: $dbcr_queryid = md5($query);
    new: $dbcr_queryid = hash(‘md5’, $query);

    i read somewhere that hash is much faster

    also when cache new results it was serializing the query results twice so i removed the second one in db-functions.php and deleted line 884 ish.

    $dbcr_cached = unserialize( $dbcr_cached );

    Everything’s working fine, and technically it should make a speed difference.

    http://wordpress.org/extend/plugins/db-cache-reloaded/

Viewing 1 replies (of 1 total)
  • Thanks for your post.

    The part of function load() which you removed is responsible for removing cache files which are too old. So this code have to be here. I can think of alternate solution for this – e.g. use of WP Cron.

    Hash() function is a bit faster than md5() – benchmark results are on page with description of hash() function. Unfortunately it is supported starting from PHP 5.1.2. I could drop support for PHP 4 (it was supported until end of 2007 only). I could add check if this function exists, but additional call to function_exists() overcomes speed benefit of hash(), so everything is slower than md5(). Therefore I will keep md5().

    I have to check the last change, and will include it in official release if needed.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: DB Cache Reloaded] i made a few tweaks’ is closed to new replies.