OptiWave | Doc
OptiWave · Page Cache
Back to Website
Home / Page Cache
Performance

Page Cache

Serve static HTML files to visitors with Layer 1 zero-PHP rewrite rules instead of running WordPress on every request. Drastically reduces Time to First Byte (TTFB) to 1ms.

OptiWave Cache tab showing browser cache toggle, cache lifespan, and mobile cache settings
The Cache tab with Layer 1 rules, lifespan, and mobile settings

How Layer 1 page caching works

Without caching, every page visit forces WordPress to execute PHP scripts, query the database, and assemble HTML. OptiWave implements a Layer 1 zero-PHP rewrite architecture: it generates static HTML, pre-compresses it into Gzip level 9 and Brotli level 11 at write time, and writes direct server rewrite rules into .htaccess, Nginx, or LiteSpeed. Visitors receive static HTML directly in 1ms without touching PHP.

Cache files are stored in a directory structure that mirrors your site URL:

wp-content/cache/optiwave/{host}/{path}/index.html
wp-content/cache/optiwave/{host}/{path}/index.mobile.html

For example, a page at https://example.com/about/ produces a cached file at:

wp-content/cache/optiwave/example.com/about/index.html
Browser cache vs page cache. Page caching is server-side - it stores the full HTML on disk. Browser caching (cache-control headers) tells the visitor browser to keep its local copy of static assets for a set period. Both work together for maximum speed.

Cache delivery flow

  1. Visitor requests a page
  2. Layer 1 server rewrite rules check for pre-compressed static files matching the URL and user agent
  3. If a valid cache exists, static HTML is delivered directly in 1ms - WordPress core and PHP are bypassed completely
  4. If no cache exists, WordPress processes the request, and OptiWave saves the rendered output to disk for subsequent visitors

Configuring cache settings

Navigate to OptiWave → Cache in the WordPress admin sidebar to access page cache settings.

Cache lifespan

SettingDefaultDescription
Cache Lifespan 10 hours How long cached files stay fresh before being regenerated. Measured in hours.

The lifespan controls when a cached file is considered stale. After the lifespan expires, the next visitor triggers a fresh render and a new cache file is created. A 10-hour default works well for most sites.

Tip. Publishing or updating a post automatically purges the cache for that specific URL.

Separate mobile cache

SettingDefaultDescription
Separate Mobile Cache Enabled Serves a different cached file for mobile user agents vs desktop user agents.

When enabled, OptiWave maintains two cache files per URL: index.html for desktop browsers and index.mobile.html for mobile user agents.

Disable separate mobile cache if your site uses a fully responsive design that serves identical HTML to all devices.

Cache query strings

SettingDefaultDescription
Cache Query Strings Disabled Whether to serve cached pages for URLs that contain query parameters (e.g., ?color=red).