I'm using cacherouter on live site (apc, memchache, eaccelerator) so I hit a lot of bugs and notices

I remake some code (cleanups & optimizations):

cacherouter.inc
* changed parameters to cache.inc style
* added comments from cache.inc
* cache_clear_all now uses new delete & flush (flush remove only old & temporary items)

Cache.php
* added check for existence $conf mappings
* lookup & look variables are in-class and sharable
* prefix now stored with '-' sign if is set

CacheRouter.php
* Fixed bug with $map (should be $this->map)
* added check for existence $conf mappings

Engines
db.php
* return 0 as in cache.inc
* overload flush to clean expired

apc memcache xcache
* lookup-keys are shared (for multisite) and now stores $expire param
* get - removed unnecessary unserialization
* set - removed unnecessary serialization, temporary items stored as persistent (clean on flush), lock optimizations
* delete - smart use of wildcards, substr changed to strpos, lock optimizations
* flush clean only temp and expired items

added eAccelerator engine

whole tar.gz attached and cumulative patches

CommentFileSizeAuthor
#1 eacc.php_.txt5.66 KBandypost
cacherouter.patch30.43 KBandypost
cacherouter.tgz14.77 KBandypost

Comments

andypost’s picture

StatusFileSize
new5.66 KB

Patch against cvs-HEAD

and forget eacc.php

slantview’s picture

Status: Needs review » Fixed

Thanks for all the hard work. Got most of your stuff in here: http://drupal.org/cvs?commit=118964

There are a few things I disagreed about your code.

#1 APC must serialize any array or object more than one level deep. (See http://t3.dotgnu.info/blog/2007/Aug/11/ and http://pecl.php.net/bugs/bug.php?id=8118)

#2 XCache must serialize any array or object as well. This is not "unnecessary serialization" but quite necessary.

#3 Didn't like the way that you rewrote the get functions. I am not sold on the expire method you choose. I am copying the way that it is currently done in the memcache module until the community comes up with another better solution. If you want to see this change, let's get a new issue going.

#4 Kept some basic stylistic changes that are the way that I prefer them.

Thanks again.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.