Path: SpeedyGo → Settings → Asset Optimization
18.1 Overview #
Defer Scripts delays JavaScript execution until after the HTML document has been fully parsed. This prevents JavaScript from blocking page rendering and improves initial load performance.
Instead of:
<script src="script.js"></script> SpeedyGo applies:
<script src="script.js" defer></script> Benefits:
- Faster initial render
- Improved First Contentful Paint (FCP)
- Reduced render blocking
- Better Lighthouse performance scores
How It Works Internally #
- Modifies eligible
<script>tags - Adds the
deferattribute - Preserves script execution order when possible
- Maintains compatibility with WordPress dependency handling
18.2 Settings #
- Go to Asset Optimization tab
- Toggle Defer Scripts → ON
⚠ Important Notes:
- Some inline or dependency-based scripts may require exclusion
- If layout or functionality breaks, exclude specific JS files
- Test forms, sliders, and interactive elements after enabling
18.3 Recommended Combination #
For best performance results, use in combination with:
- JS Minification
- JS Interaction Loader
Defer Scripts improves rendering performance by eliminating JavaScript render-blocking behavior.