I’ve enabled page caching on a site I’m currently constructing. The
sweeper is called upon any changes made to the model, as expected.
The sweeper code is as follows:
class PersonSweeper < ActionController::Caching::Sweeper
$stderr.puts “@@@@@ Expiring staff page”
expire_page( :controller => ‘welcome’, :action => ‘staff’ )
$stderr.puts “@@@@@ Staff Page Expired”
In my administrative controller, I have
class Admin::PeopleController < Admin::AdminBaseController
and finally, in the public controller, I have
class WelcomeController < ApplicationController
When I hit the public ‘staff’ page, the cache file is created. When
changes are made to the underlying data model, the sweeper method is
invoked, and I see
@@@@@ Expiring staff page
@@@@@ Staff Page Expired
in the server logs. However, the generated file in public/welcome/
staff.html is not removed.
What am I doing wrong?