Is there a method that I can use in Rails, so that whenever a simple simple find is performed on a model object, memcached first searches for the result, only if the result is not found, will there be a query made then by the database?
Ideally, I would like the solution to be implicit, so I can just write Model.find (id), it first checks the cache, and if a database request is required so that the returned object is added to the cache i.e. I do not need to wrap Model.find (id) with additional code to check the cache to match the contents.
Thanks!
source share