in reply to Re: Catalyst fcgi engine w. persistent variables
in thread Catalyst fcgi engine w. persistent variables
Basically I want some data structures to persist in memory between requests. I don't want to write them to a file, a db, memcached etc, because that's somewhat slower and memory will work just fine.
Ideally they'd expire after so long and then I'll reupdate them when I see they've expired. It doesn't matter to me if a module handles the expiration or I do it myself from a time stamp in the structure. The data itself doesn't literally need to be global everywhere, if I can get it from the context that's fine.
Something like Catalyst::Plugin::Cache with Cache::Memory as a backend would work, but from my experimenting it doesn't look like the cache persists between requests :/. Perhaps I am no utilizing it correctly however.
In my application class I merely do
__PACKAGE__->config->{'Plugin::Cache'}{backend} = { + class => "Cache::Memory", default_expires => '600 sec' + };
Then access it via $cache = $c->cache; in my controller. But the data isn't persisting between requests alas
thank you again
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Catalyst fcgi engine w. persistent variables
by Your Mother (Archbishop) on Jul 07, 2011 at 21:20 UTC | |
|
Re^3: Catalyst fcgi engine w. persistent variables
by damian45 (Novice) on Jul 07, 2011 at 19:24 UTC |