动作高速缓存未正确过期,但我有一个清理程序应该会过期几个动作高速缓存。即使调试器在调用expire_action之前立即停止,它实际上并没有过期。任何想法可能会发生什么?即使我看到它被称为
以下是相关的扫地机和控制器。
#company_sweeper.rb(在 '模型' 目录)
class CompanySweeper < ActionController::Caching::Sweeper
observe Company
def after_save(company)
expire_cache(company) if company.final_save && company.valid?
end
def expire_cache(company)
debugger <= #debugger stops here!
right before the call
I'm trying to make.
expire_action :controller => 'reports',
:action => 'full_report'
end
end
#reports_controller.rb
class ReportsController < ApplicationController
layout false
caches_action :full_report, :supplier_list, :service_categories
cache_sweeper :company_sweeper
def full_report
#do stuff...
end
end
我知道这是不是过期的方式是,报告全文返回旧数据,以及几乎是瞬间响应。奇怪,对吧?
有什么想法?....任何人? :-) – btelles 2010-02-12 19:05:32