Advertisement
swte

Clear cache cron

Mar 4th, 2020
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. add_action('template_redirect', function(){
  2.     if (isset($_GET['clear-cache']) && $_GET['clear-cache'] == 'a3ef456de32e' && class_exists('Swift_Performance_Cache')){
  3.         Swift_Performance_Cache::clear_all_cache();
  4.     }
  5. });
  6.  
  7. // Set a real cronjob: curl "https://yoursite.com/?clear-cache=a3ef456de32e"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement