R – Persistence in Ruby on Rails


Is there a way to persist data between page loads in RoR? I guess I'm looking for something like memcached, but without the overhead of TCP/IP. For example, PHP has APC.

The ideal solution would be something in memory.

Best Solution

Why don't you just store it in the session? The session can have multiple backends like memcache or even a database. I think it is possible to deploy memcache locally so It wouldn't matter that much.

Another posibility is to use a file backend and store it on a RAM drive. But maybe there are some memory libs for ruby which allow you to store these results directly into ram, but I got no experience with it.