This is the full configuration for my model, which includes heavy
caching (it's a readonly access to a data warehouse which gets updated
once a day):
cache_for: 3600 # cache results for one our
The 'Caching' trait is what allows you to use the
DBIx::Class::Cursor::Cached caching. The SchemaProxy trait allows you to
specify the default_resultset_attributes once and for all resultsets in
this model, without having to specify it in every place you use a RS
from this model.
And after that you also have to configure the caching backend:
With this configuration I didn't have to touch a single line where
queries were being executed. Just added these lines to my Catalyst
configuration (after installing the correspoding modules, of course).
Modules that I had to install from CPAN:
DBIx::Class::Cursor::Cached (I think this one is brought by Caching
trait as a dependency).
*/Jorge GonzÃ¡lez Villalonga/*
*/DAIKON IntegraciÃ³n y Desarrollo S.L./*
Telf: (+34) 91 188 08 28
Fax: (+34) 91 632 65 42
El 03/07/11 19:53, Eden Cardim escribiÃ³:
"Alex" == Alex Povolotsky<firstname.lastname@example.org> writes:
Alex> Good; how can I set default cache_time for all searches
Alex> without explicit cache_time?
Have a look at the resultset_attributes method in
-------------- next part --------------
Skipped content of type multipart/related