title: Rails 3: Expiring cached public/index.html page
body: <p>I have the following line on my <strong>routes.rb</strong> file.</p>
  
  <pre><code>root :to =&gt; "portfolio#index"
  </code></pre>
  
  <p>I cached the index page as follow:</p>
  
  <pre><code>class PortfolioController &lt; ApplicationController
    caches_page :index
  
    def index
      @portfolio = Portfolio.where("featured = ? AND enabled = ?", false, true)
    end
  end
  </code></pre>
  
  <p>And the <strong>PortfolioSweeper.rb</strong></p>
  
  <pre><code>class PortfolioSweeper &lt; ActionController::Caching::Sweeper
    observe Portfolio
  
    def after_save(portfolio)
      expire_cache(portfolio)
    end
  
    def after_destroy(portfolio)
      expire_cache(portfolio)
    end
  
    private
  
      def expire_cache(portfolio)
        expire_page :controller =&gt; 'portfolio', :action =&gt; 'index'
      end
  
  end
  </code></pre>
  
  <p>What is happening is that the <code>expire_page</code> only removes the <strong>/public/portfolio.html</strong> page but NOT <strong>/public/index.html</strong> page. Can you guys think of a way to remove both files?</p>