开发者

How to expire a caches_action with a cache_path?

开发者 https://www.devze.com 2023-01-02 07:42 出处:网络
I\'m caching an index action with the following: caches_action :index, :cache_path => Proc.new { |c| c.params }

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开发者_Python百科 parameters. How can I expire all the caches_action related to index ?

(it is a Rails 2.3.5 application)


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

expire_fragment(Regexp.new("/yourpath/youraction\\."))
0

精彩评论

暂无评论...
验证码 换一张
取 消