I’ve written a Rails application of middling complexity that makes use
of Ajax, and at some point, a particular link_to_remote calls an
action that eventually results in nearly 250K worth of generated HTML.
Takes about twenty seconds to do this on my hardware setup, and it’s
unacceptably slow for the purposes of my application. Rough profiling
shows that the main bottleneck in this process is actually the
execution of a complex set of templates, so this would definitely
benefit greatly from caching of some kind.
I’m wondering how to go about expiring the cache though. Here, I have
absolutely no need for any form of that fancy half-observer,
half-filter stuff that goes on in the Caching::Sweeper. All I want to
do is expire the cache after 5 minutes. If any cached page is more
than five minutes old, then basta, regenerate it.
What’s the simplest way to do this?