Changeset 3723128 for optimazz/trunk/includes/Modules/Cache/Manager.php
- Timestamp:
- 10/01/2026 12:31:38 PM (4 weeks ago)
- File:
-
- 1 edited
-
optimazz/trunk/includes/Modules/Cache/Manager.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
optimazz/trunk/includes/Modules/Cache/Manager.php
r3617648 r3723128 78 78 } 79 79 80 // Keep the auto-preload schedule in step with the settings right away 81 // (interval changes, preloading or caching switched off). 82 Preloader::schedule( 83 ! empty( $cache_settings['enabled'] ) && ! empty( $cache_settings['preload'] ), 84 isset( $cache_settings['preload_interval'] ) ? (string) $cache_settings['preload_interval'] : 'twicedaily' 85 ); 86 if ( empty( $cache_settings['enabled'] ) ) { 87 wp_clear_scheduled_hook( Preloader::HOOK . '_once' ); 88 Preloader::sync_due(); 89 } 90 80 91 // Browser cache headers (.htaccess) — on when caching + browser_cache are. 81 92 $browser = ! empty( $cache_settings['enabled'] ) && ! empty( $cache_settings['browser_cache'] ); 82 93 BrowserCache::apply( $browser ); 94 } 95 96 /** 97 * Purge every cached page and, when page caching and preloading are on, 98 * queue a rebuild right away. 99 * 100 * Use this whenever a SETTINGS change forces a full purge (switching a 101 * module on/off, changing an option, Undo, Reset, the post-update 102 * reconciliation, the safety guard). A bare purge leaves the cache empty 103 * until each page happens to get a visitor or the twice-daily preload runs, 104 * so the site looks uncached — and slow — after every change. 105 * 106 * @return void 107 */ 108 public static function purge_and_rewarm() { 109 self::storage()->purge_all(); 110 111 $cache = ( new \Optimazz\Core\Settings() )->for_module( 'cache' ); 112 if ( ! empty( $cache['enabled'] ) && ! empty( $cache['preload'] ) ) { 113 Preloader::queue_soon(); 114 } 83 115 } 84 116
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)