in reply to Re^2: Catalyst fcgi engine w. persistent variables
in thread Catalyst fcgi engine w. persistent variables
Yeah, I didn't check in before just trying this so I missed that you'd solved it. I'll leave some code for future readers. The docs are thin so I'm not surprised you didn't get it right the first time.
# in MyApp.pm __PACKAGE__->config( "Plugin::Cache" => { backend => { class => "Cache::MemoryCache", } }); # in MyApp::Controller::Root sub counter :Local Args(0) { my ( $self, $c ) = @_; my $counter = $c->cache->get("counter") + 1; $c->cache->set( counter => $counter ); $c->response->body("Count #" . $counter); }
Sounds like you already figured out the other parts like expiration. Have fun and realize these are volatile and if I read the docs right they share data or don't depending on the engine the app is running.
|
|---|