Manually Clear Fragment Cache in Rails

后端 未结 4 1928
攒了一身酷
攒了一身酷 2021-02-07 00:53

I\'m using Memcached with Heroku for a Rails 3.1 app. I had a bug and the wrong things are showing - the parameters were incorrect for the cache.

I had this:

4条回答
  •  天涯浪人
    2021-02-07 01:00

    Here you are:

    <% ActionController::Base.new.expire_fragment("foo_header_cache_#{@user.id}") %>
    

    Reference:
    - How to call expire_fragment from Rails Observer/Model?

提交回复
热议问题