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

Flush cache via URL / cron job #238

Open
Zodiac1978 opened this issue Jul 19, 2021 · 2 comments
Open

Flush cache via URL / cron job #238

Zodiac1978 opened this issue Jul 19, 2021 · 2 comments

Comments

@Zodiac1978
Copy link
Member

Fastest Cache is providing a smart way to trigger the cache flush via Cron Job:
https://www.wpfastestcache.com/features/clear-cache-via-url/

A user is asking if this is possible to implement in Cachify here:
https://wordpress.org/support/topic/clear-cache-using-cron-job/

The documentation mentions some action hooks but no specific working code example to do that.

How about adding this feature in this or some other way?

@stklcode
Copy link
Contributor

One can simply add a custom Cron job utilizing the cachify_flush_cache action (no arguments required) action using for example WP Control. Then the cache is flushed periodically in the regular WP cron cycle.

Second option is using WP CLI, if CLI-level is applicable in the desired case. There is a flush action available yet.

Another option is calling the …?_cachify=flush URL behind the admin bar button via Cron. However this required an active session and a Nonce… We might consider migrating this function to an WP API endpoint (there are external auth mechanisms for the API so it can still be secured)

@Barnabas2
Copy link

I utilized WP Control plugin and seems to be working nicely. Maybe the documentation could include this solution.

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

No branches or pull requests

3 participants