Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

cache_sweeper returns a blank page without log

#4584

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

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

State: duplicate
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Neeraj Singh
    Neeraj Singh

    This is a duplicate of 3914 .

    A patch is already attached to #3914 cache_sweeper yields blank output. Can someone take a look at that ticket.

    May 12th, 2010 @ 05:32 PM

  2. Ryan Bigg
    Ryan Bigg
    • State changed from new to duplicate

    May 13th, 2010 @ 11:54 PM