Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cache per day. #64

Closed
developer1031 opened this issue Oct 5, 2020 · 6 comments
Closed

Update Cache per day. #64

developer1031 opened this issue Oct 5, 2020 · 6 comments

Comments

@developer1031
Copy link

developer1031 commented Oct 5, 2020

How could I regenerate&update cached pages per day?

@robzolkos
Copy link
Contributor

@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.

@developer1031
Copy link
Author

Thank you for your kind.
As expected, CRON job....

@developer1031
Copy link
Author

developer1031 commented Oct 5, 2020

@robzolkos
Excuse me.
Could you show me simple example?

I'm asking it on stackoverflow, too

https://stackoverflow.com/questions/64206647/rails-actionpack-page-caching-update-cached-pages-per-day

@robzolkos
Copy link
Contributor

@developer1031
Copy link
Author

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

@developer1031
Copy link
Author

I used this.
Thank you.

FileUtils.rm_rf('dir/to/remove')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants