Posted on

其他性能问题-magento

备注: 也许会有其他性能问题

异步发邮件:


参考:Improve and Fix Slow Magento 2 Performance Top issues | by Yegor Shytikov | Medium

js 延迟加载/打包 优化,  用 magesuite/magepack 方案

https://github.com/magesuite/magepack
使用方式:
https://yegorshytikov.medium.com/magento-2-google-page-speed-insights-performance-optimisation-using-mage-pack-3e074ed9d1da


用户信息section性能:

https://alanstorm.com/understanding-the-limitations-of-sectionsxml/
https://amasty.com/blog/how-to-use-sections-in-magento-2/
Resolving Session Bottleneck in Magento AJAX Requests : 同步session 堵塞问题:

https://www.integer-net.com/resolving-session-bottleneck-magento-ajax-requests/


DB 检查处理 log 日志:

方法:检查 _log , _report  等表是否很大,清理:

dataflow_batch_export,

dataflow_batch_import,

log_customer,

log_quote,

log_summary,

log_summary_type,

log_url,

log_url_info,

log_visitor,

log_visitor_info,

log_visitor_online,

report_viewed_product_index,

report_compared_product_index,

report_event,

index_event,

Catalog_compare_item.


检查和清理 没用的 品类和商品,属性

attributes :Stores > Attributes > Product

https://onilab.com/blog/magento-admin-back-end-slow/


图片lazyload实现

可以尝试方案:https://github.com/aFarkas/lazysizes


字体资源****问题


解决方案1:
参考:
https://onilab.com/blog/magento-google-pagespeed-insights-optimization-guide/

解决方案2:用google font api
https://www.webfx.com/blog/web-design/google-font-api-guide/
https://medium.com/@ssniranga/how-to-add-google-font-to-magento2-98908b7e396e
https://blog.petehouston.com/add-google-fonts-to-theme-in-magento-2/


configurable-product-performance


参考文章:
https://yegorshytikov.medium.com/magento-2-configurable-product-performance-profiling-a81696a2848e


事件观察者

https://magento.stackexchange.com/questions/298020/magento-cataloginventory-observer-quantityvalidatorobserver-slow-performance

这事件和监听 ,检查是不是可以去掉, 商品列表页 执行太多次数

magento_catalog_api_data_productinterface_load_after

**-》**Magento\Framework\EntityManager\Observer\AfterEntityLoad

**-》**catalog_product_load_after

**-》**Magento\CatalogInventory\Observer\AddInventoryDataObserver

检查和去掉无用的事件监听

解决方案:

结果: