``hawksama/magento-2-performance-optimization``
Google Page Speed optimizer.
- Eliminates render-blocking CSS files by asynchronously loading CSS using RequireJS.
- Minifies the HTML without affecting KnockoutJs, RequireJs, jQuery or VanillaJs.
- Moves all script tags with either the
src
attribute or inline scripts that are loaded in the source page at the bottom of the page before closing</body>
with the ability to skip some pages or controllers. - Adds custom
critical.css
file to improveFirst Contentful Paint
score. Extends the Magento 2.3.3 functionality CSS critical path to be compatible with the new CSS asynchronously mode.
* = in production please use the --keep-generated
option
- Unzip the zip file in
app/code/Hawksama
- Enable the module by running
php bin/magento module:enable Hawksama_PerformanceOptimization
- Apply database updates by running
php bin/magento setup:upgrade
* - Flush the cache by running
php bin/magento cache:flush
- Install the module composer by running
composer require hawksama/magento-2-performance-optimization
- enable and apply database updates by running
php bin/magento setup:upgrade
* - compile the module by running
php bin/magento setup:di:compile
- Flush the cache by running
php bin/magento cache:flush
- Update the module composer by running
composer update hawksama/magento-2-performance-optimization
- apply database updates by running
php bin/magento setup:upgrade
* - compile the module by running
php bin/magento setup:di:compile
- Flush the cache by running
php bin/magento cache:flush
Module enabled by default. CSS critical path recommended.
-
Enabled (hawksama_performanceoptimization/general/enabled)
-
Minify Html (hawksama_performanceoptimization/general/minify_html)
-
RequireJS CSS (hawksama_performanceoptimization/general/requirejs_css)
-
MoveJS to bottom Enabled (hawksama_performanceoptimization/movejs/enabled)
-
MoveJS to bottom Exclude Controllers (hawksama_performanceoptimization/movejs/home_page)
-
MoveJS to bottom Exclude Paths (hawksama_performanceoptimization/movejs/controller)
-
Stores > Settings > Configuration > HAWKSAMA -> Performance Optimization
- To enable it run
php bin/magento config:set 'dev/css/use_css_critical_path' 1;
-
Helper
- Hawksama\PerformanceOptimization\Helper\Data
-
Plugin
- beforeSendResponse - Magento\Framework\App\Response\Http > Hawksama\PerformanceOptimization\Plugin\Frontend\Magento\Framework\App\Response\Http
-
Observer
- controller_front_send_response_before > Hawksama\PerformanceOptimization\Observer\Frontend\Controller\FrontSendResponseBefore
-
Block
- Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray