开发者

How can I implement write through caching in Rails 3 similar to cache-money?

开发者 https://www.devze.com 2023-03-11 09:11 出处:网络
I recently inherited a Rails 开发者_Go百科2.3 application that I\'m now trying to upgrade to Rails 3.Cache-money is an integral part of the application so I want to make sure we have the same function

I recently inherited a Rails 开发者_Go百科2.3 application that I'm now trying to upgrade to Rails 3. Cache-money is an integral part of the application so I want to make sure we have the same functionality in place when we go to Rails 3. However, my research on the subject has shown that cache-money is not compatible with Rails 3 (due to the use of unsupported AR methods :find_every and :find_from_ids).

I've seen a couple of comments and blogs mention that implementing the type of write through caching with Rails 3 that cache-money provided should be a trivial task. Any ideas on how to approach implementing write through caching with Rails 3?


Last week I launched a new write-through-cache gem for Rails 3, see https://github.com/orslumen/record-cache.

The reason I built it, is because we were using cache money in a Rails 2.3 project and recently migrated to Rails 3. So chances are, it will also serve you well.

Writing your own write-though caching in Rails 3 does not sound like a trivial task to me. If you do find a trivial way, please be sure to copy me in on that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号