I am using Magento 2.2.2 EE nginx + varnish + cdn still site is loading very slow for the very first time when I flush the cache from terminal using command 'php bin/magento cache:flush' or from backend under cache management.

If you guys have any Idea please share

Any help will be appreciated

  • Please do not execute php bin/magento cache:flush in the live site. Clear require cache only. Commented Feb 3, 2020 at 10:00
  • I think this is not a solution some time we have to flush cache. Commented Feb 3, 2020 at 10:08
  • Then if you flush cache then your site will be loading very slow. Commented Feb 3, 2020 at 10:23
  • 2
    Cache doesn't speed up Magento, it just masks the slowness. If your site has inefficiencies, they will always show up
    – jiheison
    Commented Feb 6, 2020 at 16:26
  • 1
    Agree with jiheison... Your best try would be profiling your application with cache disabled, and optimize slower parts of code Commented Feb 7, 2020 at 6:57

5 Answers 5


You need to check following things for improve site speed in Magento:

  • Update latest version of Magento 2
  • Enable Varnish Cache
  • Configure Memcached
  • Enable Flat Categories and Products
  • Merge & Minify Javascript and CSS
  • Setup Content Delivery Network
  • Use a good theme
  • Optimise Images
  • Check 3rd party extension's collection flow
  • Check third party URLs : Ex. If fonts load directly from 3rd party URL and then instead of direct URL you can download fonts and put it in your Magento and set appropriate path in less or CSS.
  • Use SVG images for icons instead of separate images and set SVG using position in CSS.

I hope it will helpful for you.


This issue can solved by running the command

php bin/magento cache:enable

the common solution for slow load.


The use of varnish cache really optimized the website speed. Apart from this you can apply the following methods:

Minify HTML, CSS and JS files

Merge CSS and Javascript

Defer parsing of Javascript

Bundle up JavaScript files

Maximum file size for Javascript Bundle Files

Set up using flat catalog category

Set up using flat catalog product

Displays product images with every scroll

Optimize and compress all product images.

Optimize cached product images on the fly

Loads the entire catalog/product images by just scrolling down

Set the number of preload images on all the pages.


You need to warm up the cache after you clear it on live sites, there are certain extensions available for the same or you can any other DSL like Blackfire player or cURL to crawl all the important pages so it loads from cache for the customers.


Found a free extension for the same, seems to use curl to warmup configured pages.


Rate Per Second = RPS

Suggestions to consider for your my.cnf [mysqld] section

innodb_lru_scan_depth=100  # from 1024 to conserve 90% of CPU cycles used for function
innodb_io_capacity=1900  # from 200 to use more of your IOPS capacity of your SSD
read_rnd_buffer_size=128K  # from 16M to reduce handler_read_rnd_next RPS of 82,131
max_connect_errors=100  # from 1,000,000 to frustrate hackers/crackers at 100 attempts to break in
max_connections=500  # from 2500 to conserve RAM footprint since max_used_connections was 251 in 66 days

You will find these configuration changes will improve loading speed and reduce CPU BUSY significantly.

These suggestions are just the tip of the iceberg and there are many more Global Variable tuning opportunities.

For additional assistance, please view my profile, Network profile for free downloadable Utility Scripts to assist with performance tuning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.