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

File Optimization

Choose when scripts and styles load, keep essential interactions working, and test changes one at a time.

Reviewed

Change one strategy at a time

Open OptiWave → File Optimization. CSS and JavaScript control both appearance and interactions, so start with caching working and a known-good copy of your settings.

JavaScript delay and Critical CSS are disabled by default. Enable one change, let it save, refresh the cache, and test the page while logged out.

Choose a JavaScript delay mode

ModeWhen scripts runWhat to check
DisabledNormal script loading.Use this baseline to investigate a broken interaction.
DeferEligible external scripts download while HTML is parsed and run after parsing.Test menus, forms, and scripts that rely on other scripts.
IdleEligible scripts wait for browser idle time.Check widgets and analytics that need to start promptly.
On InteractionEligible scripts wait for a visitor interaction or the configured fallback timeout.Check the first tap on menus, consent buttons, and checkout controls.

Defer is a useful first mode to try, but it is not a universal compatibility guarantee. Auto-Exclude Configuration Scripts is enabled by default to preserve recognized inline configuration. Dependent scripts may still need exclusions.

Load the first screen styles sooner

Critical CSS uses the cloud optimizer to identify styles needed for the initial view. It requires OptiWave Pro. Let a trusted preload worker prepare the page, then compare its desktop and mobile appearance.

If the generated styles are missing, incomplete, or fail validation, OptiWave keeps normal stylesheet delivery. A cloud stylesheet warning can mean the optimizer cannot read an asset because of a firewall. Use the administrator recovery action for the recorded page after resolving the block.

Keep essential scripts and styles loading normally

  • JavaScript exclusions: use the relevant delay exclusion control for a script that must run immediately.
  • CSS Exclusions: enter a stylesheet URL or identifying keyword, one per line, to keep it loading normally.
  • Critical CSS Safelist: enter exact selectors for states such as an open mobile menu. Only a trailing * is a wildcard; the limit is 100 entries of 200 bytes each.

Use focused entries instead of excluding every script or stylesheet. After saving, refresh the cache and repeat the failing interaction.

Make the next navigation feel faster

Instant Navigation prepares eligible same-site pages when a visitor shows interest in a link. Supporting browsers use speculation prefetch rules; other browsers use a hover fallback. It is off by default.

Administrative paths, common checkout/account paths, downloads, and query-string URLs are excluded. Add your custom private or action paths to Exclude URIs. Navigation still depends on the network and cache availability.

OptiWave keeps Cloudflare Speed Brain disabled when Instant Navigation is enabled so the two features do not compete.

HTML and off-screen content

Minify HTML removes unnecessary whitespace and comments. Minify Inline JavaScript reduces inline script size. Both are off by default.

Lazy Render HTML Elements postpones rendering of detected off-screen sections. Use Lazy Render Exclusions for elements that must appear immediately, such as the hero or navigation. Test scrolling, anchor links, and page-builder sections on mobile.

Verify before keeping the change

Test navigation, forms, sliders, consent, search, and shop flows on desktop and mobile. Check the browser console for new errors. If a page loses styling, return CSS delivery to Disabled or add the affected stylesheet to exclusions, then refresh the cache.

See the file optimization screen
OptiWave File Optimization tab showing JS delay, critical CSS, and HTML minification settings
File optimization screen reference. Labels may differ in your installed release.