buddy: Recently i build a new magento 2.2.1 vesion site, but i feel it running very slow! I first contact the magento 2.0 vesion, so i have many things need to study. Now I want to know how to optimization the magento 2.0 vesion? I have via google to search the methods, but i don't found the good methods. Maybe i'm not intelligence, so i need your help or advice? Thank you very much!
Magento is fairly slow to begin with and requires a fair amount of resources.
"Magento 2 is not slow. It simply requires you to do proper tuning of your environment before it is working as it was designed to work." - Jisse@Yireo (https://www.yireo.com/blog/1842-best-performance-for-magento-2-development)
I've used the below on sites and they seem to be performing a lot better:
I would strongly recommend the use of Varnish on Magento 2 as it comes built in with the system - http://devdocs.magento.com/guides/v2.2/config-guide/varnish/config-varnish.html
Any 3rd party modules you have installed require a full review to find any
cacheable="false" flags within XML on a block as this invalidates the entire page and not just that individual block, more info -
Setting up Redis for Session/Cache storage is also a benefit and doesn't take - http://devdocs.magento.com/guides/v2.2/config-guide/redis/config-redis.html
Lastly, don't flush/clear your cache every time you make a change! It forces Magento to re-generate all of that data. If you make a config change then only clear the Configuration cache. Any product changes you make should automatically send a purge request for that page in Varnish once setup thus avoiding performing full cache flushes on the FPC cache.
Edit - Further suggestions:
You can try installing https://github.com/magehost/performance-dashboard to get a performance dashboard on your site and can help you in setting up Magento 2 in an ideal way
Put your site through https://run.mage.coach/ and see what it comes back with, suggests performance benefits for you to implement.
By default Magento it's pretty robust and needs a lot of resources.
A first step in optimising Magento could be using Redis for page caching and session storage.
More information about this can be found in the official docs.
For deferring JS use a below extension.