How to expire a caches_action with a cache_path?

2019-04-09 00:24发布

I'm caching an index action with the following:

caches_action :index, :cache_path => Proc.new { |c| c.params }

expire_action :action => :index

The expire_action seems to only expire the index action without any parameters. How can I expire all the caches_action related to index ?

(it is a Rails 2.3.5 application)

1条回答
啃猪蹄的小仙女
2楼-- · 2019-04-09 00:53

If you're not using memcached, you can use expire_fragment with a regexp:

expire_fragment(Regexp.new("/yourpath/youraction\\."))
查看更多
登录 后发表回答