Skip to main content

Page Cache

Page caching stores rendered HTML pages on disk so repeat visitors get instant page loads without hitting your database or PHP engine.

How Page Caching Works

  1. First visitor hits your site → WordPress renders the page normally
  2. Performance Toolkit saves the rendered HTML to disk
  3. Repeat visitor hits the same URL → cached HTML is served instantly (bypassing database queries)
  4. Cache expires after the configured TTL (Time To Live)
  5. Next visitor triggers a fresh render and cache update

This can reduce page load time from 500-2000ms down to 50-200ms, dramatically improving performance.

Enabling Page Caching

  1. Go to Performance ToolkitCache
  2. Check Enable page cache
  3. Configure settings (see below)
  4. Click Save changes

Configuration

Cache TTL (Time To Live)

How long cached pages are served before invalidation.

  • Shorter TTL (1-6 hours) — fresher content, but more caching overhead
  • Longer TTL (24+ hours) — better performance, but older content for longer
  • Recommended — 3600 seconds (1 hour) for blogs; 86400 (24 hours) for mostly-static sites

Change this based on how often your content updates.

Max Cache Size (MB)

Disk space limit for cached files. When exceeded, oldest cached files are deleted.

  • Recommended — 500-2000 MB depending on your disk space and site size
  • Too small — cache becomes ineffective; mostly-static sites need more space
  • Too large — may consume unnecessary disk space

Auto-purge on Content Update

When enabled, cached pages are automatically purged when:

  • Posts/pages are published or updated
  • Comments are approved
  • Menus or navigation change
  • Theme changes

Recommended — Always enable this to prevent serving stale content.

Cache Excluded URLs

URLs that should never be cached (one URL per line):

  • /wp-admin/* — admin pages (auto-excluded)
  • /my-account/* — user dashboard/login pages
  • /cart/* — WooCommerce cart pages
  • /checkout/* — checkout process
  • /?s=* — search results

Wildcards (*) are supported. Cache pagination separately if needed.

Cache Management

Viewing Cache Status

Go to Performance ToolkitSystem Status to see:

  • Total cached pages
  • Cache size in MB
  • Cache hit rate percentage
  • Last purge timestamp

Manual Cache Clearing

To clear all cached files:

  1. Go to Performance ToolkitTools
  2. Click Clear All Cache
  3. Cached files are deleted; fresh pages render on next request

Scheduled Cache Purging

The plugin automatically purges cache on:

  • Post/page updates — purges that URL only
  • Comment approval — purges the post the comment is on
  • Settings changes — purges all cache

Troubleshooting

Cache doesn't seem to be working

  1. Confirm it's enabled — Check Performance Toolkit → Cache, ensure checkbox is checked
  2. Check cache directory permissionswp-content/cache/performance-toolkit/ must be writable
  3. View a page twice — First load renders, second load should be instant (check browser Network tab)
  4. Check cache size — If at max limit, old cache is deleted

Old content is being served

  1. Lower the TTL — Page cache interval may be too high
  2. Enable auto-purge — Ensure auto-purge on content update is enabled
  3. Manually purge — Go to Tools and clear cache immediately

Cache is filling up disk space

  1. Lower max cache size setting — Smaller cache means older files are purged sooner
  2. Increase TTL — Longer intervals mean less cache churn
  3. Check excluded URLs — Make sure you're not accidentally caching too many unique URLs

Best Practices

  • ✅ Enable auto-purge on content updates
  • ✅ Set TTL to 1-24 hours (not too short, not too long)
  • ✅ Exclude user-specific pages (account, cart, checkout)
  • ✅ Monitor cache hit rate on System Status
  • ✅ Test cache is working after enabling

Combining with Other Features

Page caching works best with:

  • File Optimization — minify assets to speed up initial load
  • Image Lazy Loading — defer image requests for faster perceived load
  • CDN Integration — serve static content from edge locations
  • Database Optimization — reduce time spent on cache misses

Combine all these for maximum performance improvement.