How to Configure Page Cache Settings in ZiziCache?

Updated on 12. 6. 2025

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 implements an advanced caching system with sophisticated features including SQLite-based cache management, stale-while-revalidate patterns, and intelligent cache warming.

Basic Cache Configuration

Enable Page Cache

To activate page caching in ZiziCache:
  1. 1. Navigate to ZiziCache > Cache
  2. 2. Check the “Enable page cache” option
  3. 3. Enable “Cache preloading (Preload)”*option
  4. 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

Configure how long cached pages remain valid before regeneration:
– Set 0: Cache files persist until manually cleared or content is updated (unlimited lifetime)
– 1 hour to X weeks: Automatic expiration intervals for dynamic content
– Custom duration: Set specific timeframes based on your content update frequency
Advanced Feature: ZiziCache implements **stale-while-revalidate** – when cache expires, it serves the stale version immediately while regenerating fresh content in the background, ensuring zero downtime.

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.

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

Setting config in wp-config.php:

// === WARMER PERFORMANCE ===
define('ZIZI_CACHE_PRELOAD_BATCH_SIZE', 5); // Conservative setting for weaker servers
define('ZIZI_CACHE_PRELOAD_TIMEOUT', 30);
define('ZIZI_CACHE_BATCH_INTERVAL', 2); // 2 seconds between batches
// === WARMER PERFORMANCE Slow shared hosting or VPS ===
define(‘ZIZI_CACHE_PRELOAD_BATCH_SIZE’, 3);
define(‘ZIZI_CACHE_BATCH_INTERVAL’, 5);
define(‘ZIZI_CACHE_MAX_CONCURRENT_PRELOADS’, 1);
// === WARMER PERFORMANCE better shared hosting or VPS ===
define(‘ZIZI_CACHE_PRELOAD_BATCH_SIZE’, 15);
define(‘ZIZI_CACHE_BATCH_INTERVAL’, 0.5);
define(‘ZIZI_CACHE_MAX_CONCURRENT_PRELOADS’, 5);
// === WARMER PERFORMANCE best VPS od dedicated server ===
define('ZIZI_CACHE_PRELOAD_BATCH_SIZE', 20);define(‘ZIZI_CACHE_LIFETIME’, 12); // Shorter lifetime, more frequent refresh
define(‘ZIZI_CACHE_STALE_GRACE_PERIOD’, 600); // 10 minutes grace period

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:
“`
woocommerce_cart_hash
wp_woocommerce_session
wordpress_logged_in_*
custom_user_preference
comment_author_*
“`
Pages won’t be cached when these cookies are detected, ensuring dynamic functionality works correctly.

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`
– **Cart status**: `-cart` (WooCommerce)
– **Custom variants**: Via `zizi_cache_cache_file_name` filter

Example cache file names:

“`
index.html.gz                    // Anonymous 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 purge-everything

wp zizi-cache purge-pages

wp zizi-cache preload-cache

wp zizi-cache purge-everything-and-preload

“`

Automatic Cache Clearing

Content Update Triggers

Cache automatically clears when:

  • Posts or pages are published, updated, or deleted
  • Comments are approved or deleted
  • Menus are modified
  • Theme customizations are saved
  • Plugin settings are updated
  • Scheduled posts are published

Smart Cache Invalidation

ZiziCache intelligently determines which cache files to clear:

  • Related pages: Category pages when posts are updated
  • Archive pages: Date archives when content changes
  • Homepage: When featured content is modified
  • Tag pages: When tagged content is updated
  • Author pages: When author posts change

Advanced Feature: The system collects all affected URLs and processes them in batches to prevent server overload during large content updates.

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]: Page served from valid cache
  • MISS [X]: Page generated dynamically
  • BYPASS [BYPASS]: Page excluded from caching
  • WARMED [W]: Page pre-generated by preload system
  • EXPIRED [EX]: Stale cache served while revalidating in background

Source Indicators:

  • PHP: Generated by PHP/WordPress
  • CACHE: Served from static cache file
  • SQLITE: Managed by SQLite coordination system

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 sophisticated cache control headers:

“`

Cache-Tag: [hostname]

CDN-Cache-Control: max-age=2592000

Cache-Control: no-cache, must-revalidate

Content-Encoding: gzip

“`

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