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
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | eacc.php_.txt | 5.66 KB | andypost |
| cacherouter.patch | 30.43 KB | andypost | |
| cacherouter.tgz | 14.77 KB | andypost |
Comments
Comment #1
andypostPatch against cvs-HEAD
and forget eacc.php
Comment #2
slantview commentedThanks 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.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.