Ben,
Thanks for the answer, but I don't really notice any difference.

I cloned the merb-cache you pointed to, then built it (I think I did
it right):
cd merb-cache
gem build merb.gemspec
sudo gem install ./merb-cache-1.0.0.gem

Then in dependencies.rb, I changed the merb-cache line to this:
dependency "merb-cache", "1.0.0"

But I still have the same nothing happening. Trying things like this
in the top of the admin/controller:
eager_cache(:update, [Post, :feed]) {{ :uri => build_url
(:posts_feed)}}
eager_cache :update, [Post, :feed]
eager_cache :update, [Post, :feed], :uri => '/posts/feed'

or this in the action:

eager_cache [Post, :feed]

with and without the :uri, and nothing seems to clear the cache for
the feed action in the posts controller.

(I do notice that more often there are no errors in the console about
dispatching errors anymore).

Any more ideas?

Bill

On Jan 15, 2:52 pm, "Ben Burkert" <[email protected]> wrote:
> Hi Bill,
>
> Are you using this version of 
> merb-cache?http://github.com/benschwarz/merb-cache/
>
> If not, I would recommend switching over.  It's going to be the official
> version of merb-cache in the future, and IIRC the :uri => ... syntax only
> works on this branch.
>
> Sorry for the confusion,
> -Ben
>
> On Thu, Jan 15, 2009 at 11:49 AM, Bill Turner <[email protected]> wrote:
>
> > Hi folks,
>
> > Basically, I think I'm running into the problem described by otto on
> > the merbunity post:http://merbunity.com/tutorials/15
>
> > "What about eager caching in a typical blog situation? You want to
> > eager cache Post#index, and dirty for Post#create, or possible
> > Post#update. But in most situations, the update and create actions are
> > in an Admin controller. How do you tell a controller that it needs to
> > dirty whenever a different controller action is called?"
>
> > How can you use eager_caching when your create/update actions are in a
> > controller separate from your show & index actions. In particular,
> > also dealing with clearing out related caches (sitemap & rss feeds -
> > also _not_ in the controller with create/update).
>
> > I'm just going to focus on the feed action, since it will be hit most
> > often:
>
> > So, in the public facing: app/controllers/posts.rb I have this at the
> > top:
>
> > cache :feed
>
> > And the caching works fine.
>
> > Now, in app/controllers/admin/posts.rb I have tried just about
> > everything to get it to eager_cache - to refresh the cache set in the
> > other controller. Here are some variations of what I've tried:
>
> > 1) at the top of the controller:
>
> > eager_cache(:update, [Post :feed]) {{ :uri => build_url(:feed_posts)}}
> > eager_cache :update, [Post, :feed], :uri => url(:feed_posts)
> > eager_cache :update, [Post, :feed], :uri => '/posts/feed.rss'
>
> > 2) in the update action:
>
> > eager_cache([Post :feed]) {{ :uri => build_url(:feed_posts)}}
> > eager_cache [Post, :feed], :uri => url(:feed_posts)
> > eager_cache [Post, :feed], :uri => '/posts/feed.rss'
>
> > And none of the above update the cache.
>
> > If it helps, here's what's in my init.rb:
>
> >  Merb::Cache.setup do
> >    unless defined? CACHE_SETUP
> >      register(:action_store, Merb::Cache::ActionStore
> > [Merb::Cache::FileStore], :dir => Merb.root / "public" / "cache")
> >      register(:default, Merb::Cache::AdhocStore[:action_store])
> >    end
> >    CACHE_SETUP = true
> >  end
>
> > Thanks in advance for help on this. the caching is the last stumbling
> > block on my upgrade from a 0.9.6 app to a 1.0.7.1 app (oh, how the
> > caching was easier then :))
>
> > Bill
--~--~---------~--~----~------------~-------~--~----~
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