Uncategorized

Image Optimization For best performance in Magento 2

In webpages, Most of the bandwidth is taken by images and it affects webpage performance drastically. So, Image optimization becomes important for the best performance. I will not turn the wheel again. I will add the most important information here only.

Lazy/Preload loading for image optimization

Concept: You can take a look at it here.
Solution: You can use a free extension from mageplaza here.
Documentation: Documentation of extension can be found here

Layout shift for image optimization

Concept: You can take a look at it here.
Solution: The solution is itself in the above link. You can add height and width for images.

Image compression/Image format/Image size

Concept: Always use images with good compression and the size of images should be as per requirement.
Solution: Optimizer, Converter

Sprite Images for image optimization

Concept: This concept is used when there is a no of small images. we combine them in one image to reduce no of requests on the server.
Solution: you can find a good tool to create CSS sprite images here

Responsive images for image optimization

Concept: You can take look at it here
Solution: The solution is itself in the above link. You can add height and width for images.

You can find more information for speed optimization here

For custom requests, you can contact me here

How to do Magento 2 performance optimization ?

Magento 2 is a pretty complex application. If you did not configure it correctly you will find it very slow. To do performance optimization, I am adding some pointers here as follows.

  1. Image optimization and lazy loading
  2. JavaScript optimization
  3. Font Optimization
  4. CSS optimization
  5. Caching techniques
  6. Server optimization
  7. Latest version of everything
  8. Light Weight theme
  9. Production mode
  10. Database optimization
  11. Code optimization
  12. Disable non required module
  13. Latest protocol http2
  14. Using Facade pattern for chat loader
  15. Serving static data from non cookie domain

Remove magento 2 redundant modules

Magento 2 has added lot of new module and feature as compared to magento1x. It has some hidden dependencies. so, it slowdown magento 2 store. It is most common list of modules which generally do not required. You can add and remove module as per your requirement. You just need to add these modules in composer.json file and then run composer update.

"replace": {
        "magento/module-authorizenet": "*",
        "magento/module-google-adwords": "*",
        "magento/module-send-friend": "*",
        "magento/module-signifyd": "*",
        "magento/module-bundle-graph-ql": "*",
        "magento/module-catalog-graph-ql": "*",
        "magento/module-catalog-inventory-graph-ql": "*",
        "magento/module-catalog-url-rewrite-graph-ql": "*",
        "magento/module-cms-graph-ql": "*",
        "magento/module-cms-url-rewrite-graph-ql": "*",
        "magento/module-inventory-graph-ql": "*",
        "magento/module-configurable-product-graph-ql": "*",
        "magento/module-customer-graph-ql": "*",
        "magento/module-downloadable-graph-ql": "*",
        "magento/module-eav-graph-ql": "*",
        "magento/module-graph-ql": "*",
        "magento/module-grouped-product-graph-ql": "*",
        "magento/module-quote-graph-ql": "*",
        "magento/module-store-graph-ql": "*",
        "magento/module-swatches-graph-ql": "*",
        "magento/module-tax-graph-ql": "*",
        "magento/module-url-rewrite-graph-ql": "*",
        "magento/module-weee-graph-ql": "*",
        "temando/module-shipping-m2": "*",
        "dotmailer/dotmailer-magento2-extension": "*",
        "klarna/module-kp": "*",
        "klarna/module-ordermanagement": "*",
        "klarna/module-core": "*",
        "amzn/amazon-pay-sdk-php": "*",
        "amzn/amazon-pay-and-login-with-amazon-core-module": "*",
        "amzn/login-with-amazon-module": "*",
        "amzn/amazon-pay-module": "*",
        "vertex/module-tax": "*",
        "vertex/sdk": "*",
        "yotpo/magento2-module-yotpo-reviews": "*"
    },