Update Cache per day.
minami-ken opened this issue · 6 comments
How could I regenerate&update cached pages per day?
@crazypioneer the docs go through an efficient way of busting the cache here
In terms of timing, as its something that is handled at the server level not the Rails app I would probably schedule this using a nightly CRON job.
Thank you for your kind.
As expected, CRON job....
@robzolkos
Excuse me.
Could you show me simple example?
I'm asking it on stackoverflow, too
This is a pretty good intruduction to cron https://www.google.com/amp/s/www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/amp/
Thank you.
Not about CRON but about updating cache.
Should I run below command inside CRON JOB function?
tmp=public/cached_pages-$(date +%s)
mv public/cached_pages $tmp
rm -rf $tmp
I used this.
Thank you.
FileUtils.rm_rf('dir/to/remove')