Expire cache in rake issue

Hate to bring back an old topic but I just came across this in my
frantic search to find a solution to much the same problem. So here it
goes:

In you rake task call: ApplicationController.expire_page(...)

Silviu lucian Vacaroiu wrote:

Hate to bring back an old topic but I just came across this in my
frantic search to find a solution to much the same problem. So here it
goes:

In you rake task call: ApplicationController.expire_page(...)

of course, make sure your environment gets setup first:

  task :expire_cache => :environment do
    ApplicationController.expire_page(:controller => "welcome")
  end

no, sorry, scratch that

I was trying it in the console and though it was working there I realize
now it's not the same thing. In the end I got away with using something
like:

task :expire_cache => :environment do
   ActionController::Base::expire_page('/')
end

In my case, I wanted to delete 'index.html' (root page-cache)