What if I told you that you can significantly improve the most important performance metric on your Magento site with a few clicks in the admin interface?
“This sounds like a bad commercial…” you would surely mumble under your breath (but you would keep reading, because, that’s why bad commercials still exist). And, you would be (partly) correct. Just like in a bad commercial, the initial claim suffers from some ifs and buts. However, there actually is such low hanging fruit in the gardens of Magento performance. Let me take you there.
The ifs and the buts
What is “the most important performance metric on a website”? TTFB (Time To First Byte).
Why? In short, because before the first byte of the requested page arrives, nothing at all happens in the browser. It’s just idle wait time, and users hate that. For the site to (at least) feel fast, it is very important to get that first byte from server to browser as quickly as possible.
What exactly is so slow and can be easily turned off? MAP (Minimum Advertised Price) [http://docs.magento.com/m1/ce/user_guide/catalog/product-price-minimum-advertised.html].
But? It shouldn’t be turned off if you are actually using it.
And, it only matters if the user has something in cart.
Most sites aren’t using MAP, so chances are you can turn it off. Users often do have something in cart, and you don’t want to irritate them with slowness at that moment. Minicart is usually shown on every page of a Magento site. So, if you can use this optimization, it will really give you the promised significant performance improvements on every page load.
So, what happens that slows the website down?
This little bugger is difficult to cache:
Magento needs to render it for every user, and when rendering, it needs to call a method named canApplyMsrp for every product in it. And that method is quite slow. However, if you turn off MAP, it is short-circuited, and has no effect on performance, as is shown in the following table:
|MAP (0 items in cart)||MAP (2 items in cart)||MAP (5 items in cart)||MAP turned off|
Numbers are milliseconds to first byte on homepage. As can be seen, MAP has no effect when nothing is in cart, but, progressively slows down page rendering when items are added to cart. And, if you turn off MAP, the rendering time, no matter how many items in cart, is the same as if there is nothing in it.
How to turn it off?
Make sure you don’t need MAP feature first!
System / Config / Sales / Minimum Advertised Price / Enable MAP -> No. Save Config.