Rails.cache, provided by ActiveSupport, can be used to cache any serializable Ruby object across requests.
To fetch a value from the cache for a given key, use cache.read:
Rails.cache.read('city')
# => nil
Use cache.write to write a value to the cache:
Rails.cache.write('city', 'Duckburgh'...