Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the speed of placing an order. #308

Open
iGerchak opened this issue Aug 1, 2024 · 2 comments
Open

Improve the speed of placing an order. #308

iGerchak opened this issue Aug 1, 2024 · 2 comments

Comments

@iGerchak
Copy link
Contributor

iGerchak commented Aug 1, 2024

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
Copy link
Contributor

cykolln commented Aug 2, 2024

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!

@xaevik
Copy link

xaevik commented Nov 19, 2024

@cykolln would still technically be prone to failure in the event of a transient network failure. My suggestion would be to leverage the kl_sync table to record the operation at the time the observer is fired and then have a cronjob run in the background to process the pending messages.

This way if transient network failures occur, it can retry in the background (up until a hard limit) without affecting the user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants