[Catalyst] clear() method for Catalyst::Plugin::Cache?

Tomas Doran bobtfish at bobtfish.net
Wed Mar 11 12:51:26 GMT 2009


Larry Leszczynski wrote:
> But I see your point about the danger of
> clearing/flushing more than you might expect.  Regardless of cache
> flavor, you could set up separate backend instances for different pools
> of data (via e.g. different cache_roots for Cache::FileCache or
> different server instances for Cache::Memcached::libmemcached) and make
> sure you only clear() the intended backend.
>   
I'd be against the method being called 'clear' as it'd be waaay to easy 
to misread the api and say $cache->clear($key)... Oops.

But having a general facility to map 
->remove_the_entire_contents_of_the_cache_yes_i_really_want_to_do_this 
(ok, maybe not quite that method name as thats a little OTT in the other 
direction) to the appropriate handwave for your specific backend sounds 
reasonable, as long as its appropriately documented..

So patch away!

Cheers
t0m







More information about the Catalyst mailing list