On 6/19/06, Jason A. Crome <[EMAIL PROTECTED]> wrote:
On Jun 19, 2006, at 12:45 PM, Graham TerMarsch wrote:
> Oh, this sounds nice. :)) I'm regularly having to deal with needs
> to caches
> in various parts of our applications, but having something
> integrate directly
> with C-A would be -sweet-.
I am looking forward to seeing this as well!!
> $self->cache(['memory','memcached'])->get( $key );
>
SNIP
>
> $self->cache('*')->get( $key );
>
> to query against "all known caches, in no guaranteed order"?
Again, great suggestions. I had long been struggling for a way to
specify what caches should be searched at config() time. You could
also expand this logic to set for which caches to set a value in. get
() could become a bit hairy though.
I think that for simplicity sake, doing a set or get without
specifying a named cache should automatically go to each of the
caches.
Remember that setting a value in a memory cache as well as a disk
cache is not necesarily a waste of resources, because the disk cache
is shared across multiple processes wheras the memory cache would be
limited to the current process (same goes for memory mapped files, and
memcached like setups which are also shared caches).
An alternate solution would be to allow the user to configure a
'default' cache (or list of caches). That could then also be used to
solve the ordering issue.
default => ['memory', 'memcached'],
Or if you want different values for get and set allow 'default' to be
overriden with these:
default_get => ['memory', 'memcached'],
default_set => ['memory'],
In the end, I suspect that the majority of users will just use a
single caching system. So it is important to remember to make the
common case easy.
Cheers,
Cees
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]