Thanks Ben. Somehow I completely missed the fetch_fragment method! I
was sure I'd looked through all of merb-cache.

Anyway in the meantime I got the following working which uses the same
API as the old merb-cache. Posting in case it's useful for anyone.

  def cache(key, timeout, &block)
    Merb::Cache[:default].fetch(key, {}, :expire_in => timeout) do
      capture(&block)
    end
  end

On Fri, Oct 17, 2008 at 5:46 PM, Ben Burkert <[EMAIL PROTECTED]> wrote:
> Richard Grundy (RichGuk) has also started an merb-cache example app that
> should give you a better idea of how to use fetch_fragment than
> community_shelf: http://github.com/RichGuk/merb-cache-example/
>
> On Fri, Oct 17, 2008 at 11:41 AM, Ben Burkert <[EMAIL PROTECTED]> wrote:
>>
>> Martyn,
>>
>> Fragment caching is back in merb-cache, using the fetch_partial &
>> fetch_fragment methods.  The article you mentioned is a bit outdated, and
>> there's a screencast on merb-cache that will be part of the merbcamp
>> videos.  It's also available here:
>> http://blip.tv/file/get/Benburkert-erbmaacheca145.mov
>>
>> The screencast covers fragment caching, here's the code if you want to
>> skip the video:
>> http://github.com/benburkert/community_shelf/tree/master/app/views/dash/index.html.haml
>>
>> -Ben
>>
>> On Fri, Oct 17, 2008 at 6:46 AM, Martyn Loughran <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> According to the tutorial on the new merb-cache
>>> (http://merbunity.com/tutorials/15), fragment caching is coming in the
>>> 'near future'. I was just wondering what the progress is on this.
>>>
>>> I am assuming that it's not going to get into merb 1.0 since we've hit
>>> a feature freeze? This seems like a pretty large omission, since in
>>> many applications page and action caching are not possible. Please let
>>> me know if I'm missing something obvious here!
>>>
>>> If you've created a fragment cache wrapper around AdhocStore please do
>>> let me know - if not I may have a go at writing one.
>>>
>>> Thanks,
>>>
>>> Martyn
>>>
>>>
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to