I'm not quite sure how to ensure my caching is working, but I'm pretty sure it's not. I have a users controller with an index action that I'm action caching until a new user is created. Here's the code:
UsersController < ApplicationController
caches_action :index
def index
@users = User.all
end
def create
expires_action :index
...
end
end
Now, in my logs when I access the index
action, I see:
Cached fragment hit: views/localhost:3000/users (0.0ms)
Filter chain halted as [#<ActionController::Filters::AroundFilter:0xe2fbd3 @identifier=nil, @kind=:filter, @options={:only=>#<Set: {"index", "new"}>, :if=>nil, :unless=>nil}, @method=#<Proc:0x186cb11@/Users/bradrobertson/.rvm/gems/jruby-1.5.3/gems/actionpack-2.3.10/lib/action_controller/caching/actions.rb:64>>] did_not_yield.
I'm not sure what the filter chain halted ... did_not_yield
is all about and I also see that that select * from users
... is getting called each time, which is not what I expected.
Can someone enlighten me as to what's going on here and why this isn't behaving as I would expect? ie. why the User.all would be running when that whole action's output should have been cached ?