OptiWave | Doc
OptiWave · File Optimization
Back to Website
Home / File Optimization
Render-blocking resources

File Optimization

Eliminate render-blocking JavaScript and CSS, minify HTML, prefetch same-origin links with Speculation Rules API, and deliver only critical above-the-fold styles.

OptiWave File Optimization tab showing JS delay, critical CSS, and HTML minification settings
The File Optimization tab with JS delay, critical CSS, and minification controls

How render-blocking resources slow your site

When a browser loads a WordPress page, it must download and parse every CSS file and execute every JavaScript file it encounters. Scripts and stylesheets in the <head> block rendering: the browser stops painting until those resources are fully loaded and processed.

OptiWave attacks render-blocking bloat from three angles:

  • JavaScript delay strategies - Defer, Idle, and On Interaction delay modes
  • Cloud Critical CSS generation - Extracts above-the-fold CSS styles with zero server CPU load
  • Instant Navigation (Speculation Rules API) - Prefetches same-origin links on hover for 0ms instant page loads
Auto-excluding configuration scripts. OptiWave automatically excludes inline configuration scripts ending in -js-extra or -js-before from delay processing. This eliminates jQuery is not defined and undefined variable errors that plague other speed plugins.

JavaScript delay modes

The delay_all_js setting controls how JavaScript is loaded in OptiWave:

ModeHow it worksBest forTrade-offs
Disabled Scripts load normally without delay processing Troubleshooting broken scripts No JS delay speed boost
Defer [REC] Adds defer attribute. Browser downloads scripts during HTML parsing, executes after DOM is ready Recommended safe default for all sites Scripts execute before first paint
Idle Defers execution until browser idle time via requestIdleCallback Analytics and non-critical tracking widgets Slower devices may execute later
On Interaction Delays scripts until user interacts (scroll, click, touch, or keypress) Landing pages with heavy third-party scripts Analytics fire after interaction

Instant Navigation (Speculation Rules API)

OptiWave injects browser-native <script type="speculationrules"> rules to prefetch same-origin pages when a user hovers over a link with a moderate eagerness threshold.

Automated E-Commerce Safety. OptiWave automatically excludes /cart/*, /checkout/*, /my-account/*, and session query strings from speculative prerendering to protect WooCommerce stores.