hawksama/magento-2-performance-optimization 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hawksama/magento-2-performance-optimization

最新稳定版本:v1.0.6

Composer 安装命令:

composer require hawksama/magento-2-performance-optimization

包简介

Loads the CSS using RequireJS. This helps to speed up the website by loading CSS using requireJS asynchronously. Production mode required.

README 文档

README

``hawksama/magento-2-performance-optimization``

Main Functionalities

Google Page Speed optimizer.

Main features

  • 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 improve First Contentful Paint score. Extends the Magento 2.3.3 functionality CSS critical path to be compatible with the new CSS asynchronously mode.

Installation

* = in production please use the --keep-generated option

Type 1: Zip file

  • 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

Type 2: Composer

  • 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

How to upgrade

  • 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

Configuration

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

Activate CSS critical path

  • To enable it run php bin/magento config:set 'dev/css/use_css_critical_path' 1;

Specifications

  • 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

Support

统计信息

  • 总下载量: 569
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2021-09-01