the_it_nerd / module-performance
IT极客 - Magento 2 性能模块。
0.0.5
2024-09-18 13:17 UTC
Requires
- magento/framework: >=102.0.0
- magento/magento-composer-installer: *
- the_it_nerd/module-core: *
README
为Magento实现了性能提升。
- 预加载 https://mdn.org.cn/en-US/docs/Web/HTML/Attributes/rel/preload
- 预取 https://mdn.org.cn/en-US/docs/Glossary/Prefetch
- 预连接 https://developer.chrome.com/en/docs/lighthouse/performance/uses-rel-preconnect
- 懒加载 https://mdn.org.cn/en-US/docs/Web/Performance/Lazy_loading
- 服务器推送 https://www.smashingmagazine.com/2017/04/guide-http2-server-push
通过HttpResponse中的插件,我们在页面中实现了上述所有概念。我们通过正则表达式在页面HTML中进行搜索并实现上述提到的概念。
对于预连接,您可以在商店 > 配置 > IT极客 > 性能 > 其他预连接条目中根据需要添加新的外部链接。默认情况下,我们已经添加了这些带有预连接的url。
对于服务器推送,您可以在商店 > 配置 > IT极客 > 性能 > 服务器推送 > 其他图片中根据需要添加新的资源。