[Catalyst] Tutorial for cache?

Graeme Lawton glawton at alola.org
Thu Apr 16 07:54:26 GMT 2009


Also Catalyst::Plugin::Cache::Store::FastMmap is now deprecated as you
can use it without store, and should see a slight performance
improvement.

Graeme


2009/4/16 Tomas Doran <bobtfish at bobtfish.net>:
>
> On 16 Apr 2009, at 07:32, Alexander Tamm wrote:
>
>> Tomas Doran wrote:
>>
>>> Take a look at Catalyst::Plugin::Cache. The docs are a bit crap (patches
>>> welcome!), but it'll do what you want, and has nice features to give you
>>> curried accessors for things etc..
>>
>> Well, that's just it... I've read the docs and tried to configure it, but
>> I never get a cache hit.
>>
>> I've tried this:
>>
>> in MyApp.pm:
>> __PACKAGE__->config(
>>                    # other stuff.
>>                    'Plugin::Cache' => {
>>                              'backend' => {
>>                                       store => 'FastMmap',
>>                              },
>>                     },
>>                );
>> ...but the return value of $c->cache->get->($key) is always undef,
>> although I make sure to always $c->cache->set( $key, $value)
>>
>> So I'm pretty sure I've missed something.
>
> Are you using version >= 0.07? The config key changed, and you're using the
> new key, which will be ignored if your plugin isn't recent enough.
>
> Also, I really recommend you switch to memcache, as (1) it had great
> debugging you can just turn on, (2) in the worst case, you can pull out
> wireshark, (3) its cache eviction policies are generally more sane and
> understandable than fastmmap, (4) you can get useful stats like the hit rate
> out of it..
>
> Cheers
> t0m
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>



More information about the Catalyst mailing list