Cache Lite

Lightweight full-page HTML caching for a faster WordPress site

Cache Lite renders a page once and serves the saved HTML to subsequent visitors instead of re-running PHP and database queries every time. The cache purges itself automatically when content changes, respects a configurable TTL, and can also be cleared manually from the admin bar.

Key features

  • Automatic invalidation on publishing or editing a post — purges only the affected pages, not the whole cache
  • Manual "Purge all" right from the admin bar
  • Configurable TTL — cache entries expire and refresh on their own
  • Logged-in users are deliberately excluded from the cache, as are pages with cache-busting cookies (configurable, e.g. a WooCommerce cart cookie)
  • WooCommerce’s add-to-cart and wc-ajax requests are excluded from caching by design, so the cart always behaves correctly
  • Optional automatic preload after a purge, so early visitors don’t hit a cold cache
  • Debug headers available for verifying hit/miss behavior while testing
  • Other modules and third-party plugins can trigger a purge programmatically via SMRK_Cache::purge_all() / purge_url(), or a plain do_action('smrk_cache_purge') with zero hard dependency on this module

How it works

The first request to a page renders through PHP/Timber as usual, but the output is additionally saved as a static HTML file. The next request to the same URL is served straight from that file, before the rest of the WordPress bootstrap even loads — which is why the speed-up is so noticeable.

Invalidation hooks into the standard post-save actions (save_post and similar) and only purges the cache files actually affected by that change, not the whole cache at once. Excluding logged-in users, WooCommerce cookies and add-to-cart/wc-ajax requests is built directly into the condition that decides whether a page gets cached at all — so dynamic content never ends up saved as static for everyone.

Compared to alternatives

Cache Lite is deliberately the "lite" option compared to WP Super Cache, W3 Total Cache, WP Rocket, LiteSpeed Cache or WP Fastest Cache — just full-page HTML caching, without a dozen unrelated optimization features bundled in.

Frequently asked questions

Is this safe for a WooCommerce store?
Yes — logged-in users, cache-busting cookies (like the cart) and add-to-cart/wc-ajax requests are deliberately excluded from caching.
Do I have to purge the cache manually after editing a post?
No, saving or publishing a post automatically purges the affected pages. A manual "Purge all" is also available.
How do I tell if a page was served from cache?
The module can output debug headers showing whether a request was a hit or a miss.