How to Configure Page Cache Settings in ZiziCache?

Updated on 10. 2. 2026

Page Cache Overview

Page caching is the cornerstone of ZiziCache performance optimization. It creates static HTML files of your dynamic WordPress pages, allowing them to be served instantly without processing PHP or querying the database. This dramatically reduces server load and improves page loading speeds.
ZiziCache supports file-based page cache with optional LiteSpeed cache mode. For file cache, expired pages are served stale while a refresh is queued in SQLite; the refresh worker then rebuilds pages in the background. Cache file variants can be created per mobile device, user role, language, currency, and WooCommerce cart state.

Basic Cache Configuration

Cache Mode (Auto / LiteSpeed / File)

Choose how ZiziCache serves page cache:
  • Auto: detect LiteSpeed and use LSCache; otherwise use file cache.
  • LiteSpeed: force LiteSpeed cache only (no file cache).
  • File: force ZiziCache file-based cache only.
Note: If LiteSpeed mode is selected on a non‑LiteSpeed server, file cache is skipped and caching is effectively off.

Enable Page Cache

To activate page caching in ZiziCache:
  1. Navigate to ZiziCache > Cache
  2. Check the „Enable page cache“ option
  3. Enable „Cache preloading (Preload)“*option
  4. Click „Save cache settings“
Once enabled, ZiziCache will automatically start generating cached versions of your pages as visitors browse your site.

Cache Lifetime Settings

Cache lifetime is defined in hours:
  • 0 hours: disables page cache.
  • 1+ hours: cached files expire after the given number of hours.
Stale-while-revalidate (file cache): when a cached file is expired, ZiziCache can serve the stale file immediately and queue a refresh in SQLite. In LiteSpeed-only mode, expiry is handled by LiteSpeed.

Advanced Cache Options

Logged-in User Caching

Configure caching behavior for authenticated users:
  1. Disabled (default): Logged-in users always see fresh content
  2. Enabled: Cache personalized content with user-specific cache files
  3. Use case: Suitable for membership sites with static member content
Advanced Feature: User role-based cache variants create separate cache files for different user roles, ensuring appropriate content delivery.

Separate Mobile Cache

When enabled, ZiziCache creates an extra cache variant for mobile devices (suffix -mobile). Tablets are treated as desktop by default (filter: zizi_cache_tablet_is_mobile).

Cache 404 Page

Optional 404 caching stores a single 404 template as 404.html.gz (and 404-mobile.html.gz when mobile cache is enabled) to reduce bot load.

Advanced Cache Preloading System

ZiziCache implements a sophisticated cache warming system:

Batch Processing Preloader

  1. Batch size: Processes URLs in configurable batches (default: 5 URLs per batch)
  2. Background processing: Uses WordPress cron system for non-blocking cache generation
  3. Queue management: Maintains intelligent URL queue with duplicate prevention
  4. Server protection: Prevents overload during large cache regeneration

SQLite-Based Cache Management

  1. Coordination database: Uses SQLite for managing expired cache regeneration
  2. Asynchronous refresh: Handles background cache updates without blocking requests
  3. Smart queuing: Prevents duplicate refresh requests for the same URL
Optional wp-config.php overrides for the SQLite worker:
// Override SQLite expired-cache worker batch size/interval
define('ZIZI_PRELOAD_BATCH', 20);
define('ZIZI_PRELOAD_INTERVAL', 30); // seconds

Preload Benefits

  1. Immediate cache: Ensures first visitors get cached content
  2. Zero downtime: Stale-while-revalidate pattern maintains site speed
  3. Automatic warming: Content updates trigger immediate cache regeneration

Bypass Cookies

Configure cookies that prevent caching when present (these are also bypassed by default in WooCommerce):
woocommerce_cart_hash
woocommerce_items_in_cart
wp_woocommerce_session_
woocommerce_recently_viewed
wordpress_logged_in_*
comment_author_*
Pages won’t be cached when these cookies are detected, ensuring dynamic functionality works correctly.

Built-in Bypass Conditions (always active)

  • Non‑GET/HEAD requests (POST, PUT, DELETE, etc.)
  • REST API requests (/wp-json/)
  • WP‑CLI context
  • Page builder/editor query parameters (Elementor, Bricks, Divi, etc.)
  • Debug/query bypass params: nocache, bypass_optimization, zizi_bypass, cache_bust
  • Preload requests (X-Zizi-Preload / X-Zizi-Warmed)

Query Parameter Handling

ZiziCache ignores known tracking parameters and can include specific parameters to create cache variations. Unknown parameters bypass caching by default. Manage this in Cache Exclusions.

Cache File Management

Cache Storage Location

ZiziCache stores cache files in `/wp-content/cache/zizi-cache/` with automatic security protection through .htaccess files that prevent direct access.

Advanced Cache File Naming Convention

Cache files use sophisticated naming based on multiple dimensions:
Base Structure:
„`
/wp-content/cache/zizi-cache/[host]/[path]/[filename].html.gz
„`

Multi-dimensional Cache Variants:

– **User role suffix**: `-administrator`, `-editor`, `-subscriber`
– **Language codes**: `-en`, `-cs`, `-de` (Polylang, WPML, TranslatePress)
– **Currency codes**: `-USD`, `-EUR`, `-CZK` (Aelia, YITH, WCML)
– **Login status**: `-logged-in`
– **Mobile**: `-mobile` (when separate mobile cache is enabled)
– **Cart status**: `-cart` (WooCommerce)
– **Query variations**: `-` suffix for allowed query parameters
– **Custom variants**: Via `zizi_cache_cache_file_name` filter

Example cache file names:

„`
index.html.gz // Anonymous visitor
index-mobile.html.gz // Anonymous mobile visitor
index-logged-in-en-USD.html.gz // Logged-in English user with USD currency
index-subscriber-cs-cart.html.gz // Czech subscriber with items in cart
„`

Manual Cache Management

Control cache through multiple interfaces:
Admin Bar Options:
  1. Clear All Cache: Removes all cached files
  2. Clear Page Cache: Removes current page cache only
  3. Preload Cache: Regenerates cache for all pages

WP-CLI Commands:

„`bash
wp zizi-cache preload-cache
wp zizi-cache purge-pages
wp zizi-cache purge-pages-and-preload
wp zizi-cache purge-everything
wp zizi-cache purge-everything-and-preload
„`

Note: purge-pages clears the entire HTML page cache (not a single URL).

Automatic Cache Clearing

Content Update Triggers

Cache automatically clears when:

  • Posts/pages are published or updated (published content only)
  • Scheduled posts are published
  • Comment count changes (new/approved/deleted comments)
  • Selected ZiziCache settings are saved (e.g., image/iframe settings) and trigger a purge

Smart Cache Invalidation

ZiziCache determines which URLs to refresh:

  • Post URL and homepage
  • Posts page (blog index)
  • Post type archive
  • Author archive
  • Taxonomy archives (terms + parent terms)

Advanced Feature: The system collects affected URLs and processes them in batches to reduce server load.

Performance Monitoring

Enhanced Cache Status Headers

ZiziCache provides detailed cache status information through HTTP headers:

„`

x-zizi-cache-cache: [STATUS] [CODE]

x-zizi-cache-source: [SOURCE]

„`

Complete Status Types:

  • HIT [OK]: Served from valid cache file
  • MISS [X]: Page generated dynamically
  • BYPASS [BYPASS]: Cache intentionally skipped (reason tag may appear)
  • PRELOAD [WARMED]: Cache generated by preload system
  • MANUAL [CACHED]: Cache created by manual action
  • EXPIRED [EX]: Stale cache served while refresh is queued
Note: x-zizi-cache-source is set to PHP on misses; for cache hits rely on x-zizi-cache-cache.

Cache Hit Rate Monitoring

Monitor cache effectiveness through:

  • Browser Developer Tools: Check Network tab for cache headers
  • Server Response Headers: Look for `x-zizi-cache-cache` values
  • Performance Metrics: Monitor page load time improvements
  • Log Analysis: Review ZiziCache log files for cache statistics

Advanced Cache Headers

ZiziCache adds cache control headers such as:

„`
Cache-Tag: [hostname]
CDN-Cache-Control: max-age=2592000
Cache-Control: public, max-age=31536000
Content-Encoding: gzip
X-ZiziCache-Version: [plugin version]
X-ZiziCache-Served: [GMT timestamp]
Last-Modified: [cache file timestamp]
„`

Browsers may receive 304 Not Modified responses when If-Modified-Since matches the cache file timestamp.

Troubleshooting Cache Issues

Common Problems and Solutions

Pages Not Caching

Causes:

  1. URL matches bypass rules
  2. Bypass cookies present
  3. User logged in with disabled logged-in caching
  4. POST request instead of GET
  5. Content not HTML

Solutions:

  • Review exclusion rules in Advanced settings
  • Check for bypass cookies
  • Verify request method
  • Test with anonymous user

Stale Content Issues

Causes:

  • Automatic cache clearing disabled
  • Cache lifetime too long
  • Content updates not triggering cache clear

Solutions:

  • Verify automatic cache clearing settings
  • Manually clear specific page cache
  • Check content update hooks

Storage and Permission Issues

Causes:

  • Insufficient disk space
  • Wrong file permissions
  • Cache directory not writable

Solutions:

  • Monitor `/wp-content/cache/zizi-cache/` storage
  • Set cache directory permissions to 755
  • Ensure WordPress can write to cache directory

Debug Cache Behavior

Enable comprehensive debugging:

  1. Cache Headers: Check browser developer tools for cache status
  2. Log Files: Review `/wp-content/plugins/zizi-cache/zizi-log.log`
  3. User Role Testing: Test with different user roles and permissions
  4. Device Testing: Verify mobile and desktop cache variants
  5. Security Files: Ensure `.htaccess` files exist in cache directories

Advanced Debugging

SQLite Database Inspection:

The cache coordination database is located at:

„`

/wp-content/cache/zizi-cache/preload.sqlite

„`

Queue File Monitoring:

The preload queue is maintained in:

„`

/wp-content/cache/zizi-cache/preloader-list.txt

„`

Best Practices

Optimal Configuration Strategy

  1. Start Conservative: Begin with basic settings and gradually optimize
  2. Test Incrementally: Verify functionality after enabling each feature
  3. Monitor Performance: Use tools like GTmetrix or Google PageSpeed Insights
  4. Regular Maintenance: Periodically clear cache and monitor storage usage

E-commerce Specific Considerations

Essential Exclusions

„`

/checkout/

/cart/

/my-account/

/?add-to-cart=*

/?wc-ajax=*

„`

Cookie-based Exclusions

„`

woocommerce_cart_hash

woocommerce_items_in_cart

wp_woocommerce_session_*

„`

Multi-currency Support

  • Enable currency-based cache variations
  • Configure appropriate currency plugins (Aelia, YITH, WCML)
  • Test cache variants for different currencies

Multilingual Site Configuration

Supported Plugins

  • Polylang: Automatic language-based cache variants
  • WPML: Currency and language cache variations
  • TranslatePress: Language-specific cache files

Best Practices

  • Enable language-based cache variants
  • Test cache files for all languages
  • Monitor cache storage for multiple language variants

Performance Optimization Tips

  1. Cache Preloading: Always enable for better first-visit performance
  2. Batch Size: Adjust preload batch size based on server capacity
  3. Cache Lifetime: Balance between freshness and performance
  4. Exclusion Rules: Be specific to avoid over-exclusion
  5. Monitoring: Regularly check cache hit rates and performance metrics

Advanced Configuration Examples

High-Traffic Website

„`

Cache Lifetime: 24 hours

Preload: Enabled (batch size: 10)

Logged-in Caching: Enabled

Cache Variants: Language + Currency

Exclusion Rules: Minimal, specific only

„`

E-commerce Store

„`

Cache Lifetime: 6 hours

Preload: Enabled (batch size: 5)

Logged-in Caching: Disabled

Cache Variants: Currency + Language

Exclusion Rules: All checkout/cart pages

Bypass Cookies: All WooCommerce session cookies

„`

Membership Site

„`

Cache Lifetime: 12 hours

Preload: Enabled (batch size: 3)

Logged-in Caching: Enabled

Cache Variants: User Role + Language

Exclusion Rules: Member-specific content

Role-based Variants: All user roles

„`

Conclusion

Proper page cache configuration is essential for optimal website performance. ZiziCache’s advanced caching system with SQLite coordination, stale-while-revalidate patterns, and intelligent cache warming provides enterprise-level performance optimization.

Start with basic settings and gradually implement advanced features based on your specific requirements. Always test thoroughly and monitor performance metrics to ensure optimal configuration for your content management workflow.

The sophisticated cache management system ensures zero downtime during cache regeneration while maintaining fresh content delivery, making it suitable for high-traffic websites, e-commerce stores, and complex multilingual sites.

What are your feelings