This project is archived and is in readonly mode.

#4584 ✓duplicate
Damien MATHIEU

cache_sweeper returns a blank page without log

Reported by Damien MATHIEU | May 12th, 2010 @ 04:34 PM

I'm trying to do some fragment caching.
And to clear the cache whenever some objects are created/updated.

However it seems cache_sweeper doesn't works as we'd expect it to.

In my controller I have :

class PagesController < ApplicationController
    cache_sweeper    :page_sweeper, :only => [:create, :update, :destroy]

And in my sweeper :

class PageSweeper < ActionController::Caching::Sweeper
    observe Page

    def after_save(page)
        expire_cache_for(page)
    end

    def after_destroy(page)
        expire_cache_for(page)
    end

    private
    def expire_cache_for(page)
        expire_fragment("page_#{post.id}")
    end
end

Then when a sweeping cache action is called, I get only a blank page without anything in the log.

Started POST "/me/pages" for 127.0.0.1 at 2010-05-12 17:35:10

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages