SHOW:
|
|
- or go back to the newest paste.
| 1 | add_action('template_redirect', function(){
| |
| 2 | - | if (isset($_GET['clear-cache']) && $_GET['clear-cache'] == 'a3ef456de32e' && class_exists('Swift_Performance_Cache')){
|
| 2 | + | if (isset($_GET['reset-warmup']) && $_GET['reset-warmup'] == 'a3ef456de32e' && class_exists('Swift_Performance_Cache')){
|
| 3 | - | Swift_Performance_Cache::clear_all_cache(); |
| 3 | + | global $wpdb; |
| 4 | $wpdb->query('DROP TABLE IF EXISTS ' . SWIFT_PERFORMANCE_TABLE_PREFIX . 'warmup');
| |
| 5 | delete_option(SWIFT_PERFORMANCE_TABLE_PREFIX . 'db_version'); | |
| 6 | delete_transient('swift_performance_initial_prebuild_links');
| |
| 7 | Swift_Performance::db_install(); | |
| 8 | Swift_Performance_Cache::clear_all_cache(); | |
| 9 | Swift_Performance::get_prebuild_urls(); | |
| 10 | } | |
| 11 | }); | |
| 12 | ||
| 13 | // Set a real cronjob: curl "https://yoursite.com/?clear-cache=a3ef456de32e" |