Caching in Ruby Gem, possibly not using Rails

Posted by corprew on Stack Overflow See other posts from Stack Overflow or by corprew
Published on 2010-05-13T18:22:56Z Indexed on 2010/05/13 21:34 UTC
Read the original article Hit count: 164

Filed under:
|
|

I am rewriting an existing Ruby Gem to include caching. This is for a gem that is relatively commonly used, and accesses a large amount of static data on a web service. Currently, I have a small number of gem users doing a large number of accesses to the service that under normal conditions would be swamping / downing the service, and we're going to put the gem up on github for general consumption.

Right now, users can choose between using the rails cache mechanism, a simple disk cache, or no cache.

What is best practice for letting people choose what cache to use like this (being able to use this outside of rails is a priority so i can't just bail to the underlying caching mechanism)? I'm looking for suggestions/examples for configuration and interface, especially.

Thanks for your suggestions

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about caching