Welcome to the Google PageSpeed Optimizer Documentation. Whether you are a new or an advanced user, you can find some useful information here.
First of all, we recommend you check the following link:
php -f bin/magento module:enable Mirasvit_Core Mirasvit_Optimize Mirasvit_ImageLazyLoad Mirasvit_OptimizeCss Mirasvit_OptimizeHtml Mirasvit_OptimizeInsight Mirasvit_OptimizeJs Mirasvit_OptimizeImage
php -f bin/magento setup:upgrade
php -f bin/magento cache:clean
Deploy static view files:
rm -rf pub/static/frontend/*; rm -rf pub/static/backend/*; rm -rf var/view_preprocessed/*;
php -f bin/magento setup:static-content:deploy
Make sure that the native Magento cronjob is configured and working correctly. The extension performs all tasks in cron.
The settings of the Google PageSpeed Optimizer is grouped into the following sections:
This configuration section was designed for checking the page speed rate of your website for desktop and mobile versions.
The Run GoogleSpeed Test is used to run a quick speed test for your website's home page.
bin/magento setup:static-content:deploy
after saving the configurations.bin/magento setup:static-content:deploy
after saving the configurations.Ignore URL List - the list of pages (URL patterns) where JS will not move.
Or a list of JS files (patterns for SCRIPT tags) that should not be moved.
For example:
Each pattern on the new line.
bin/magento setup:static-content:deploy
after saving the configurations.bin/magento setup:static-content:deploy
after saving the configurations.The extension uses a set of tools in optimizing or converting images. Images get optimized in the pub/media folder.
To check the status of tools, please run the command: bin/magento mirasvit:optimize-image:validate
sudo yum install <library_name>
(Centos) or sudo apt-get install <library_name>
(Ubuntu).
sudo apt-get install jpegoptim optipng gifsicle webp imagemagick
bin/magento mirasvit:optimize-image:optimize
- Run images optimization processbin/magento mirasvit:optimize-image:webp
- Create a copy of the images in .webp formatfetchpriority="high"
to images, preloaded according to the config Preload first N images. .some-class-image {
backgroud-image: url(...);
}
.some-class-size {
height: 300px;
}
Bad \
.some-class {
backgroud-image: url(...);
height: 300px;
}
bin/magento setup:static-content:deploy
after saving the configurations./pub/static/version1600338479/frontend/Magento/luma/en_US/fonts/Luma-Icons.woff2
preconnect::
suffix.preconnect::https://maxcdn.bootstrapcdn.com/
Since Magento Cloud projects have writing restrictions, to configure the extension in regards to the static content, the extension settings should be placed inside the [root_store_path]/app/etc/config.php file.
The config, most typical for the majority of Magento stores should look like this:
'system' => [
'default' => [
'dev' => [
'template' => [
'minify_html' => 1 // minify HTML
],
'js' => [
'merge_files' => 0, // merge JS files
'minify_files' => 1, // minify JS files
],
'css' => [
'merge_css_files' => 1, // merge CSS files
'minify_files' => 1, // minify CSS files
]
]
],
'mst_optimize' => [
'optimize_js' => [
'enabled' => 1, // enable JS optimizations, also enables advanced JS bundling. If you'd like to disable this feature it is recommended to disable all JS optimizations along with disabling this setting
'minify_js' => 1, // minify JS files
'merge_js' => 0 // merge JS files
],
'optimize_css' => [
'merge_css' => 1, // merge CSS files
'minify_css' => 1 // minify CSS files
],
'optimize_html' => [
'minify_html' => 1 // minify HTML
]
],
]
Where the default/dev
part of the system
config array is the default Magento settings and the mst_optimize
part is our extension settings.
This config should be placed inside the first-level array in the [root_store_path]/app/etc/config.php file.
As our extension extends from some of Magento's default functionality, the default settings and settings of our extension should be changed accordingly.
For example, default/dev/template/minify_html
should be changed together with mst_optimize/optimize_html/minify_html
.
In the above config, comments are added to explain which configs are related and should be changed correspondingly.
Remove these comments before adding the config to the [root_store_path]/app/etc/config.php file.
default/dev
and the mst_optimize
section of the configuration array.
All other extension settings can be safely changed from the admin panel of the store.
Usage: php -f bin/magento [options]
bin/magento mirasvit:optimize-insight:pagespeed https://example.com/
bin/magento mirasvit:optimize-image:validate
Run the image optimization process and generate webp images:
bin/magento mirasvit:optimize-image:optimize
This command has next options:
--image
- optimize images according to the Image Quality level which is set in the configurations --webp
- generate webp images with the compression according to the Image Quality level
The extension also runs image optimizations and webp images generation processes on a cron basis
bin/magento mirasvit:optimize-image:restore
To upgrade the extension, follow these steps:
composer require mirasvit/module-optimize:* --update-with-dependencies
composer update mirasvit/*
command. It will update all the Mirasvit modules installed in your store. php -f bin/magento module:enable Mirasvit_Core Mirasvit_Optimize Mirasvit_ImageLazyLoad Mirasvit_OptimizeCss Mirasvit_OptimizeHtml Mirasvit_OptimizeInsight Mirasvit_OptimizeJs Mirasvit_OptimizeImage
php -f bin/magento setup:upgrade
php -f bin/magento cache:clean
rm -rf pub/static/frontend/*; rm -rf pub/static/backend/*; rm -rf var/view_preprocessed/*;
php -f bin/magento setup:static-content:deploy
To temporarily disable the extension please follow the following steps:
php -f bin/magento module:disable Mirasvit_Optimize Mirasvit_ImageLazyLoad Mirasvit_OptimizeCss Mirasvit_OptimizeHtml Mirasvit_OptimizeInsight Mirasvit_OptimizeJs Mirasvit_OptimizeImage
To uninstall the extension, please follow these steps:
composer remove mirasvit/module-optimize
(2024-11-25)
(2024-11-19)
(2024-10-29)
(2024-10-28)
(2024-10-21)
(2024-10-21)
(2024-10-11)
(2024-10-08)
(2024-09-16)
(2024-08-19)
(2024-04-22)
(2024-03-25)
(2024-02-20)
(2024-01-24)
(2024-01-23)
(2023-12-20)
(2023-12-07)
(2023-10-23)
(2023-10-05)
(2023-09-05)
(2023-08-16)
(2023-07-28)
(2023-07-25)
(2023-07-24)
(2023-07-14)
(2023-06-06)
(2023-04-20)
(2023-03-16)
(2023-03-06)
(2023-03-02)
(2023-01-20)
(2022-11-15)
(2022-08-18)
(2022-06-09)
(2022-06-08)
(2022-05-27)
(2022-01-21)
(2021-12-02)
(2021-10-18)
(2021-10-13)
(2021-09-07)
(2021-07-27)
(2021-07-15)
(2021-07-06)
(2021-06-29)
(2021-06-22)
(2021-06-16)
(2021-06-14)
(2021-06-11)
(2021-05-20)
(2021-05-13)
(2021-05-05)
(2021-04-30)
(2021-04-29)
(2021-04-26)
(2021-04-21)
(2021-04-08)
(2021-04-06)
(2021-03-19)
(2021-03-12)
(2021-03-12)
(2021-03-11)
(2021-02-04)
(2021-01-15)
(2021-01-14)
(2020-12-24)
(2020-12-16)
(2020-12-15)
(2020-12-11)
(2020-12-09)
(2020-12-07)
(2020-11-25)
(2020-11-19)
(2020-11-18)
(2020-11-12)
(2020-11-09)
(2020-11-03)
(2020-10-19)
(2020-10-06)
(2020-10-01)
(2020-09-16)
(2020-09-15)
(2020-09-10)
(2020-09-07)
(2020-09-04)
(2020-09-01)
(2020-08-27)
(2020-07-29)
(2020-06-17)
(2020-06-02)
(2020-04-23)
(2020-03-10)
(2020-03-05)
(2020-02-10)
(2020-02-03)
(2020-01-24)
(2020-01-02)
(2019-12-26)
(2019-12-25)
(2019-12-24)
(2019-12-23)
(2019-12-23)
(2019-12-18)
(2019-12-16)
(2019-12-11)