I'm writing an app that does a lot of data visualization using RMagick. Most of the pages in my app are pretty basic with a few textual descriptions of the data and then a bunch of img tags linking to other actions that render the graphs and use send_data to send the images to the client.
Most of the data we work with gets uploaded via an import script each night so the pages and graphs are basically static throughout the day when all of our users are hitting the page. I'd like to cache the generated images server side and then use standard rails sweepers to invalidate it when the import script (which uses all our standard models) runs.
It seems that caches_action and caches_page do not work when no view is actually rendered (i.e. send_data is used to send the response.) I've done a fair amount of Googling and haven't found anything about this yet, but I thought it would be worth a post here to see if anyone knew of a clean easy way to do this.
Thanks in advance, Mike