Quite wrong title not relevant to MongoDB. And it can be done much easier using redis-store and standart caches_action method.
https://github.com/jodosha/redis-store
http://stackoverflow.com/questions/1988658/rails-action-cach...
https://github.com/jodosha/redis-store
http://stackoverflow.com/questions/1988658/rails-action-cach...