Developer Integration Overview
This guide lists the actual hooks and filters implemented in the current ZiziCache codebase. Hooks are grouped by feature area and include only verified names.
Action Hooks
zizi_cache_before_optimizations— Fires before the HTML optimization pipeline runs.zizi_cache_purge_urls:before($urls) — Before purging a list of URLs.zizi_cache_purge_urls:after($urls) — After purging a list of URLs.zizi_cache_purge_url:before($url) — Before purging a single URL.zizi_cache_purge_url:after($url) — After purging a single URL.zizi_cache_purge_pages:before— Before full page cache purge.zizi_cache_purge_pages:after— After full page cache purge.zizi_cache_purge_everything:before— Before full cache purge (pages + assets).zizi_cache_purge_everything:after— After full cache purge.zizi_cache_purge_all— Fired by integration layer to request a full purge.zizi_cache_update_config:after($config) — After configuration update/migration.zizi_cache_upgraded— Fires after config upgrade/migration.zizi_cache_litespeed_auto_tag— Fired when LiteSpeed auto-tagging runs.zizi_cache_database_after_options— After database cleanup options are processed.zizi_cache_db_growth_alert($alerts,$total_size) — When database growth alert is triggered.zizi_cache_db_event_logged($action,$message,$context) — After database event is logged.zizi_cache_acf_options_purged($post_id,$urls,$cache_mode) — ACF integration after options purge (only when ACF integration is active).zizi_cache_language_switched($language) — TranslatePress integration (only when TranslatePress integration is active).
Filter Hooks
zizi_cache_allowed_roles($roles) — Allowed roles for ZiziCache admin access.zizi_cache_auto_purge_urls($urls,$post_id) — Extend URLs auto-purged on content changes.zizi_cache_trackable_urls($urls) — URLs stored in Cache URLs tracker.zizi_cache_request_uri($request_uri) — Override request URI used for cache keying.zizi_cache_cache_file_path($path) — Override cache file path.zizi_cache_cache_file_name($file_name) — Override cache file name.zizi_cache_tablet_is_mobile($is_mobile) — Treat tablets as mobile in cache logic.zizi_cache_is_mobile($is_mobile) — Final mobile detection override.zizi_cache_is_cacheable($is_cacheable) — Final cacheability decision.zizi_cache_cache_excluded_roles($roles) — Roles excluded from caching.zizi_cache_page_builder_params($params) — Query params used to detect page builder sessions.zizi_cache_known_query_params($params) — Known query params for cache key normalization.zizi_cache_exclude_from_minify:css($keywords) — CSS minify exclusions (literal hook name includes colon).zizi_cache_exclude_from_minify:js($keywords) — JS minify exclusions (literal hook name includes colon).zizi_cache_js_delay_timeout($seconds) — Timeout for JS delay fallback.zizi_cache_used_css($css,$url_type) — Override extracted Used CSS before caching.zizi_cache_css_excluded_selectors($selectors) — Selectors excluded from RUCSS removal.zizi_cache_preload_delay($seconds) — Delay before preload oncache_bust.zizi_cache_preload_variant_delay($seconds) — Delay between desktop/mobile preload variants.zizi_cache_preload_is_cacheable($is_cacheable,$content,$url) — Preload cacheability override.zizi_cache_preload_urls($urls) — Extend the preload URL list.zizi_cache_optimization:after($html) — Final HTML output filter (literal hook name includes colon).zizi_cache_footprint($html_comment) — Customize preload/warmed footprint comment.zizi_cache_main_htaccess_rules($rules) — Modify main .htaccess rules.zizi_cache_litespeed_vary_cookies($cookies) — LiteSpeed vary cookie list.zizi_cache_litespeed_only_htaccess_rules($rules) — Modify LiteSpeed-only .htaccess rules.zizi_cache_image_converter_htaccess_rules($rules) — Modify Image Converter .htaccess rules.zizi_cache_youtube_placeholder_resolution($resolution) — Override YouTube placeholder resolution.zizi_cache_disabled_integrations($slugs) — Disable specific integrations by slug.zizi_cache_should_apply_quicklink($enabled) — Enable/disable Quicklink injection.zizi_cache_should_apply_speculation($enabled) — Enable/disable Speculation Rules injection.zizi_cache_page_builder_detection($result) — Override page builder detection result.zizi_cache_acf_options_purge_urls($urls,$options_page_id) — ACF options purge URL list.zizi_cache_db_alert_recipients($emails) — Override database growth alert recipients.zizicache_cwv_allowed_metrics($metrics) — Allowed CWV metric types.zizicache_cwv_rate_limit_window($seconds) — CWV rate-limit window.zizicache_cwv_rate_limit($count) — CWV rate-limit requests per window.zizicache_font_rate_limit($count) — Font collection rate limit.
Quick Reference
| Hook | Type | Purpose |
|---|---|---|
| zizi_cache_purge_urls:before | Action | Intercept URL purges |
| zizi_cache_preload_urls | Filter | Add URLs to preload |
| zizi_cache_is_cacheable | Filter | Override cacheability |
| zizi_cache_update_config:after | Action | React to config changes |
| zizi_cache_main_htaccess_rules | Filter | Modify generated .htaccess |
Examples
Add custom preload URLs
add_filter('zizi_cache_preload_urls', function($urls) {
$urls[] = home_url('/pricing/');
$urls[] = home_url('/contact/');
return $urls;
});
Allow a custom admin role
add_filter('zizi_cache_allowed_roles', function($roles) {
$roles[] = 'shop_manager';
return $roles;
});
Skip Quicklink on specific pages
add_filter('zizi_cache_should_apply_quicklink', function($enabled) {
if (is_page('checkout')) {
return false;
}
return $enabled;
});
Notes
- Hooks with a colon (e.g.,
zizi_cache_exclude_from_minify:css) are literal names. - Integration-specific hooks only fire if that integration is active.
- Prefer filters over direct overrides when customizing behavior.