partial cache

0 views
Skip to first unread message

mike

unread,
Jun 26, 2009, 12:52:44 PM6/26/09
to merb
Hi,
I'd like to partially cache some actions (cache partials by exemple),
Is there a way to do this in merb ? how ?

Thx.

vintrepid

unread,
Jun 29, 2009, 12:51:23 PM6/29/09
to merb
I cache partial templates in my app by registering a fragment store:

register(:fragment_store, Merb::Cache::FileStore, :dir =>
Merb.root / :tmp / :fragments)

and using it in my templates (haml) like:

-fetch_fragment({:cache_key => "some-path/#
{@some_item.item_identifier}"}) do
=partial 'some_template'


You may have already found this, but there are some docs at:

http://wiki.merbivore.com/cache

Take a look at the example apps at github.

Vince
Reply all
Reply to author
Forward
0 new messages