I have a page which renders a lot of partials. I fragment cache them all, which makes it very fast. Horray!
The thing is, that because of the amount of partials, the first run, when writing the cache, takes so long, the request timeout (but the other times are really fast)
I also use sidekiq (but the question is relevant to any background processor)
Is there a way to save those partials in a background process so users that miss the cache (due to expiration) won't have a timeout? So I would go over all partials, and those of which the cache expired (or is going to expire soon) I will recache them?