Related to the question i have asked previously How to store a database intensive page into cache from a background process in rails
i want to write a partial into cache from a background process every 15 mins. And when ever a user request comes in i can just read the partial from the cache and render it and never explicitly expiring it.
Is there any ways to actually do it?
Thanks,
I think what you want is to read the results of the db query with:
and update it from a cron job 15 minutely with:
Then allow your partial to regenerate every 15 minutes as well (or every time even), since that's not the intensive part of the operation.
N.B.