klaviyo / magento2-klaviyo

37 stars 51 forks source link

Improve the speed of placing an order. #308

Open iGerchak opened 1 month ago

iGerchak commented 1 month ago

Description

We investigated the speed of placing an order and found that API request to subscribe email to the Klaviyo takes a big part of the time. In the middle, it's about 500ms and in our case, it's about 9% of the time placing an order. I propose moving this functionality to the crone job or moving it to the "Thank you" page, which will not affect placing orders.

Expected behavior

API request to subscribe email to the Klaviyo will not affect placing orders speed.

Benefits

Placing an order will be faster in about 500ms. In case Klaviyo has an outage, it not will have the ability to break a placed order.

Additional information

No response

cykolln commented 1 month ago

Hi @iGerchak thanks for raising this! We currently observe on custom_fields_sales_address_save so we can pull out the custom values we throw into that section. We can take a look on we can optimize this pattern to save some ms!