Shopify Checkout Throttling and Queue
See original GitHub issueThis repository is missing two critical features required for large Shopify stores:
Checkout-level throttle Shopify limits the amount of checkouts that can be created on the Storefront API per minute. If an API client exceeds this throttle, then a 200 Throttled error response is returned. Shopify recommends designing your app to be resilient to this scenario. For example, you could implement a request queue with an exponential backoff algorithm.
/throttle/queue Shopify redirects users in the checkout flow to
/throttle/queue
if the store is under high traffic.
Without these features, two things will happen. The API silently fails when creating a checkout session, meaning that addToCart requests also silently fail. Also, during the checkout flow, the user will be redirected to a nonexistent URL.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
@ottomated just created a PR with your suggestion to create a checkout only on the fist cart interaction, not the very first visit of the store.
I started also to implement the Cart API instead of Checkout, i will make a PR with that too when is finished.
@balakedev would be nice for the community to create a PR when you have a fix or an improvement so we all can benefit from it 😃. Cart API was released last month, and is available only on the unstable version of the Storefront API (Ajax Cart API cannot be used for Headless Storefronts).
@ottomated, I might be able to help you with this issue as my team has solved it. There’s only a few lines of code to change to stop useCart() initialising a cart immediately on page view and only triggering it on add to cart. Happy to collaborate here.