Re: Poet::Cache not working for Mason components

Jonathan Swartz <[email protected]> Thu, 16 Jan 2014 04:41:50 -0800
Newsgroups gmane.comp.web.mason.user
Message-ID <[email protected]>
In Poet::Mason it sets the default cache_root_class to Poet's Cache class:

method get_options ($class:) {
    my %defaults = (
        cache_root_class => $poet->app_class('Cache'),

There is a Poet test for this in Poet::t::PSGIHandler (test_cache). Is this test passing for you?

Jon

On Jan 13, 2014, at 4:42 AM, Kamil Niechajewicz <[email protected]> wrote:

> Hello,
> 
> We wanted to start using Poet::Cache in our application and discovered a really weird problem. Following manual from here (http://search.cpan.org/~jswartz/Poet-0.10/lib/Poet/Cache.pm), we need to configure default cache store - I did it for Memcached, in global.cfg:
> 
> cache:
>     defaults:
>          driver: Memcached
>          servers: ["127.0.0.1:11211"]
> 
> Then I should just start my app and use $m->cache in Mason components, right? The problem is - whenever I use $m->cache, it uses File driver instead of Memcached. I checked and it looks like Poet::Cache works well when used from scripts or Perl modules (it loads correct cache object), but for Mason components its always default File cache.
> 
> This led me to Mason::Plugins::Cache and I realized that I have no idea how this class works together with Poet's caching. It seems that the problem lies somewhere in between - Poet's configuration is not passed correctly to Mason::Plugin, but why?
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today. 
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk_______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk

_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users