Improve PageSpeed score
The optimal combination of settings in the Google PageSpeed Optimizer extension depends on your specific store setup. Each store is unique - themes, third-party modules, and hosting environments all affect how optimization features perform.
That’s why there is no single “perfect” configuration. Instead, you can use the following as a recommended starting point and adjust as needed for your store’s design and functionality.
Recommended Settings
1. JavaScript Optimization
Enable all available JavaScript optimizations:
- Enable JavaScript Optimization: Yes
- Minify JavaScript: Yes
- Move JavaScript to Page Bottom: Yes
These settings reduce script size and ensure non-critical JS loads after main content.
2. CSS Optimization
Recommended setup for CSS:
- Merge CSS Files: Yes
- Minify CSS Files: Yes
- Move CSS to Page Bottom: Yes (disable if layout issues occur)
- Defer Google Fonts: Yes
This combination helps minimize render-blocking resources and speed up visual loading.
3. Image Optimization
Optimal image settings:
- Image Quality Level: 80%
- Image Optimization Strategy: Webpages
- Use WebP Images: Yes
- Enable Lazy Load: Yes
These settings strike the best balance between image quality and performance.
4. HTML Optimization
- Minify HTML: Yes
Removes unnecessary spaces and comments from HTML output, improving transfer time.
5. Other Settings
Keep default values for options under Other. If any cause layout or JS issues, you can safely disable only the problematic ones.
Important notes
Static content deployment
Settings such as Merge and Minify require static content to be redeployed. If you don’t redeploy, you might see layout or JavaScript errors on the frontend.
bin/magento setup:static-content:deploy
Theme or module compatibility
Some third-party themes or extensions may conflict with Magento’s native Merge and Minify features. If you notice layout breaks or missing elements after enabling these settings, this indicates that the affected theme or module isn’t compatible with these optimizations.
WebP and JavaScript bundling
The effects of WebP optimization and JavaScript bundling may take time to appear.
-
The WebP feature gradually converts images through the cron process. Make sure Magento cron jobs are configured and running properly.
-
The JavaScript bundling feature collects scripts during visits to different page types. Bundling completes after a full deployment cycle and subsequent visits across the site.
To verify that all required image optimization libraries are installed, run:
bin/magento mirasvit:optimize-image:validate
To manually start image optimization, use:
bin/magento mirasvit:optimize-image:optimize
Since the optimizer processes a limited number of images per iteration, run the command multiple times to complete optimization faster.
Optimization strategy
For best results:
- Enable one feature at a time and check your PageSpeed Insights score.
- Measure the effect of each optimization before proceeding to the next.
- Keep a balance between high performance and full functionality - sometimes disabling one feature may improve user experience more than a marginal gain in score.