Rails.cache.fetch not overwriting current value

If you notice a Rails cache call not overwriting the previously entered value, for instance:

Rails.cache.fetch("your_key") do 
  your_random_value
end

 
Try passing the force flag to fetch, like this:

Rails.cache.fetch("your_key", :force=>true) do 
  your_random_value
end

 
And it should work without a problem.

ABOUT THE AUTHOR

Anthony Leon

Author has no description.

NO COMMENTS

Leave a comment

Your email is never published or shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>