My Rails application has a simple yaml file that’s downloaded relatively frequently (5x per second). The file is updated very infrequently (at most once per day). I don’t want to YAML::load the file every time it’s requested. What’s the best way to cache this result?
My Rails application has a simple yaml file that’s downloaded relatively frequently (5x per
Share
Rails provides an easy to using caching system:
if the cache store doesn’t contain some key then the block is evaluated and the result stored in the cache. There are several stores you can choose from, such as memcache, in memory, or the file system.