Post

Railsのキャッシュ機構を使う

キャッシュの使い方

ids = Rails.cache.fetch('key', expired_in: 12.hour) do Table.pluck :id end

キャッシュのクリーン

$ bundle exec rails r 'Rails.cache.clear'
[【Rails】cacheを消したい時のワンライナー https://qiita.com/kon_yu/items/5d570e97c277c8cc2dd0]
This post is licensed under CC BY 4.0 by the author.