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
Cache delivery flow
- Visitor requests a page
- Layer 1 server rewrite rules check for pre-compressed static files matching the URL and user agent
- If a valid cache exists, static HTML is delivered directly in 1ms - WordPress core and PHP are bypassed completely
- 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
| Setting | Default | Description |
|---|---|---|
| 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.
Separate mobile cache
| Setting | Default | Description |
|---|---|---|
| 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.
Cache query strings
| Setting | Default | Description |
|---|---|---|
| Cache Query Strings | Disabled | Whether to serve cached pages for URLs that contain query parameters (e.g., ?color=red). |