Hi Jim, here is a link to handle caching.

http://merbivore.com/documentation/1.0/doc/rdoc/merb-cache-1.0/index.html

page and action caching are about half-way down the page. I have just
done rails caching, but this looks pretty sweet. It also goes into
detail on how to expire the caches as well.



On May 21, 2:50 am, Jim Morris <[email protected]> wrote:
> Hi,
>
> I have implemented page caching on my simple blog engine. I use an
> apache mod_rewrite rule that will pick up any page caches, so far so
> good.
>
> Now if someone posts a comment to the blog, it won't show up because
> the page is in the cache, and the request will never reach Merb.
>
> I see that delete_all is not implemented for the page_store, so how
> can I flush the page cache so the new comment will be rendered?
>
> So far it looks like I need to do a rm -rf public/cache/* which is
> nasty.
>
> Ideally though it would be nice to just delete the cached show page,
> but really the index page needs to be flushed too as I have a list of
> recent comments.
>
> To make things harder comments are created in a different controller
> to the posts.
>
> So is there a better way to do this other than...
>
> after :flush_cache
>
> def flush_cache
>   FileUtils.rm_r $MERB_ROOT /  "public/cache/*"
> end
>
> Thanks for any help here.
>
> PS I could use the action_store instead but that is so much slower,
> and I'm not even sure that can be flushed.

--~--~---------~--~----~------------~-------~--~----~
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