[Catalyst] Partial page cache plugin

Octavian Râsnita orasnita at gmail.com
Mon Dec 7 21:31:21 GMT 2009


From: "Larry Leszczynski" <larryl at emailplus.org>

>
> On Sun, 06 Dec 2009 19:07 -0600, "Peter Karman" <peter at peknet.com>
> wrote:
>> Julien Sobrier wrote on 12/6/09 2:04 AM:
>> > Hello,
>> > there is a plugin for caching an entire page.  I am looking for the 
>> > same
>> > type of plugin to cache part of the page, but did not find one. Waht is 
>> > the
>> > best way to achieve this in Catalyst?
>> >
>>
>> If you are using Template Toolkit,
>>
>> http://search.cpan.org/dist/Template-Plugin-Cache/
>
> Agree, this will do what you want.  To have it use your Catalyst cache,
> just do something like this:
>
>   USE cache = Cache('cache' => c.cache);
>
> You can use it to cache either a whole page or just part of one, since
> you can "cache.inc()" or "cache.proc()" to INCLUDE or PROCESS any
> template (or BLOCK? not sure...) from inside another one.


Template::Plugin::Cache is great, but unfortunately it gives errors when the 
template contains UTF-8 chars which are not also ASCII chars (or if the 
template uses I18N and the translated string contain those special chars).

Perrin Harkins, the author of the module told me that the problem is the 
Cache module, and that the solution is to pass a CHI object instead of a 
Cache one.

Hope this helps.

But by the way, I've seen that there are no CHI plugins for Catalyst even 
though CHI seems to be an improved version of the Cache module. Is there a 
reason for this indiference for CHI? (some kind of incompatibility with 
Catalyst, or some hidden defects of that module...)

Octavian




More information about the Catalyst mailing list