Hi,
First of all, let me say I am very new to rails, have been working with it for only a couple of days.
My first application is a little different from traditional: on one of my model classes I have parts of data that is pulled from a database and other part that is acquired by doing an HTTP REST request to an external resource.
I have implemented lazy loading for the "external" resource but, every time the user hits a page that needs one of the fields that are tied to that resource, I re-execute the HTTP request, which obviously doesn't scale.
My question would be: what caching strategy do you think is worth for this scenario? How can I have a cache only for the data that is lazy loaded via HTTP? I'd like to implement a cache that could expire both by time (let's say 5 minutes) or when user executes an action that should invalidate this current cache.
How can I implement it and what would be the memory trade-off to keep those caches? Would it be advisable to keep that data on a session or on a separate structure on the server? Should I consider one of those external caching frameworks like GigaSpaces, etc...?
Thanks in advance for any tips you may offer to this problem.