Drupal 8. How to clear cache at 12 am? Or another specific hour, for example 2pm, 7pm etc.
Drupal 8. How to clear cache at 12 am? Or another specific hour
1k Views Asked by Aleksandr At
2
There are 2 best solutions below
0

You can do it outside of Drupal, using a cron job on your server to call drush cr
for your site.
In case you are not familiar with cron, please refer here: https://opensource.com/article/17/11/how-use-cron-linux
Example:
1. Edit crontab:crontab -e
0 0 * * * cd <path_to_your_document_root> && drush cr
Check out also on CacheFlush module: https://www.drupal.org/project/cacheflush/