Warming Rails Jbuilder Caches on the Console

So you’re being a good Rails developer and are using Jbuilder to render your JSON in your Rails 4 app. Better yet, you’re following best practices: you’ve split up your views into nested partials and are caching the generated JSON results in Memcache. Huzzah!

Except, you’ve got a view where even the fastest queries can take 2 seconds to respond, and you have about 30 of them per page, and they expire without user interaction, which means they wont be regenerated in the typical request-response cycle. Hmm. You definitely do not want your user sitting there for 60 seconds while your page loads.

Continue reading