JavaScript Combination merges multiple JS files into a single optimized file to reduce HTTP requests and improve load efficiency.
14.1 Overview #
Instead of loading multiple JavaScript files separately, SpeedyGo combines them into one consolidated file.
Benefits:
- Fewer HTTP requests
- Improved load efficiency
- Better performance on HTTP/1.1 servers
However, combining JavaScript can sometimes:
- Break execution order
- Cause console errors
- Conflict with inline scripts
How It Works Internally #
- Collects eligible enqueued JS files
- Preserves dependency order where possible
- Merges scripts into a single cached file
- Serves the combined file from the cache directory
14.2 Settings #
Enable JavaScript Combination #
- Toggle JavaScript Combination → ON
Exclude JS Files #
If errors occur, add problematic file paths in the Exclude JS Files box.
Example:
/wp-content/plugins/plugin-name/script.js
After making changes, always clear cache and re-test your website functionality.
14.3 Best Practice Recommendation #
- Test interactive elements and forms carefully
- Exclude scripts that rely on strict execution timing
- Compare performance metrics before and after enabling
- Disable if running on HTTP/2 and no measurable benefit is observed
JavaScript Combination improves performance when properly configured and tested.