0

Magento2 I want to reduce TTFB of my site. In google page optimization the highest priority is of TTFB. enter image description here

My home page contains 1. Logo, search, Menu, Banner Image, Popular items block, brand slider & footer with normal links.

From all of these how can I reduce TTFB

I have already merged CSS, merged JS, minified them etc.. Production mode.

Any suggestion are welcome. Thanks.

2 Answers 2

0

To reduce your TTFB: If possible use varnish cache: https://devdocs.magento.com/guides/v2.3/config-guide/varnish/config-varnish.html

To trace down bottlenecks you can use the magento profiler: https://devdocs.magento.com/guides/v2.3/config-guide/bootstrap/mage-profiler.html

Some third party modules offer more infos, e.g. https://github.com/Smile-SA/magento2-module-debug-toolbar

If you want to go deep have a look at blackfire.io

To further improve your page speed result

Getting a good google page speed result with magento 2 is kind of hard. The currently best results are probably made with custom optimizations and https://github.com/magesuite/magepack

But be aware that most of this isn't plug and play and will come with a risk.

0

Here is what I would do:

  1. Connect a code profiler (new relic, tideways or similar, just google for them) to the website and see what code exactly is slowing the site down.

For example here is a callgraph of a website I was working on:

enter image description here

See curl_exec takes more than 1s to execute. That's not normal and that relates to ElasticSearch taking too long to run queries. That needs to be investigated and fixed. Your case could be different but a code profiler will tell you exactly what's wrong.

  1. Still couldn't figure it out. Try a 3rd-party extension audit. From my experience of optimizing Magento 2, in most cases it's a poorly coded custom plugin that's responsible for hight TTFBs.

Do the following - turn off all custom modules and see if it makes the site faster. If it does - turn them on one by one and find which one(s) breaks performance.

You could turn a module off by running:

php bin/magento module:disable Vendor_ModuleName

To see a list of all modules:

php bin/magento module:status
  1. Switch to a Luma theme. See if it makes a difference, if it does - you know it's a custom theme that's slowing you down and you need to investigate it further. Code profiler will help in that case.

Of course, it could be as simple as caching being off, in that case run:

php bin/magento cache:enable

Good luck!

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.