Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expiring an action cache #53

Open
mzaragoza opened this issue Oct 14, 2017 · 4 comments
Open

expiring an action cache #53

mzaragoza opened this issue Oct 14, 2017 · 4 comments

Comments

@mzaragoza
Copy link

I added this to my project and its working fine but I am having a problem expiring the cache

my controller looks like

class PostsController < ApplicationController
  caches_action :show

   def show 
     @post = Post.find(params[:id])
   end
end

it works fine when I visit different post but when a post gets updated it does not reflect that

Thanks

@zedtux
Copy link

zedtux commented Nov 16, 2017

@mzaragoza you are right, the documentation of this gem is not complete. You have to use a so called Sweeper.

Have a look at the rails-observers README.

@andreevmap
Copy link

Можно обновлять так:
expire_action controller: "posts", action: "show"
Но данный метод не работает из другого контроллера!
Может кто подскажет как его вызвать из другого контроллера?

@andreevmap
Copy link

@zedtux
rails-observers is not working for rails 5.. end mongoid

@vanboom
Copy link

vanboom commented Apr 29, 2021

👍 It would be nice to have a cache_key type of control over the expiration of the cache at the controller level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants