On Fri, 1 Sep 2006, Dan McCormick wrote: > This works well, but is a bit bulky to go cutting and pasting everywhere > that uses $m->cache_self, so I'd like to component-ize it. That's > proving a bit tricky however, as I think instead of calling > $m->call_self, I'd have to somehow capture the output of the caller, > which I figure is impossible. > > But I thought I'd ask -- does anyone have any clever solutions?
You could try a component-with-content. Something along the lines of: my $result = $cache->get($cache_key); unless ($result) { $resuit = $m->content; $cache->set($cache_key, $result, $ttl); } $m->print($result); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users