Magento 2 - Speed Optmization

     21 Steps to improve Magento 2 Application performance
  1. Production Mode

    Why Production mode needed?
    Production mode also better performance because static view files are populated in the pub/static directory and because of code compilation.

    - Run below command in terminal to get current application mode:

    $ bin/magento deploy:mode:show

    - Now set the application mode to production:

    $ bin/magento deploy:mode:set production

    It will take a while to switch the mode, because if will execute some other necessary commands to generate files like compilation.

    - If you want to skip the compilation for any reason use below command  :

    $ bin/magento deploy:mode:set production

  2. Minify JS and CSS

  3. Check TTFB and try to reduce it

  4. Enable Flat Categories and Products

  5. Enable GZIP compression

  6. Never Use JS bundling

  7. Upgrade to latest(stable) PHP version

  8. Use Varnish Cache instead of built in Magento cache. (optional)

  9. Image optimization

  10. Check every 3rd-party extensions (Avoid conflicts between 3rd party extensions)

  11. Upgrade hosting to fasted server

  12. Check code SQL query execution time (optimize queries)

  13. Enable profiler and check the time (specific IP restriction mode).

  14. Use CDN (Content Delivery Network)

  15. Check your website speed in waterfall

  16. Disable unnecessary module

  17. Remove cacheable="false" from XML that will prevent page caching

  18. Increase server configuration

  19. Update Magento 2 version to the latest

  20. Use APIs instead of controller for specific actions

  21. Use elastic search instead of MySql