
Checkout performance is a major factor in helping merchants get more sales, which is why we strive to ensure that shipping rates at checkout load at the optimal speed and without perceptible delay.
If you build shipping apps, that also means that your app needs to be just as fast. To help app developers create optimal checkout experiences and return shipping options fast (< 500ms) and reliably, we have consolidated a list of six best practices to improve the checkout performance of your shipping app.
Whether you want to build apps for the Shopify App Store, offer custom app development services, or are looking for ways to grow your user base, the Shopify Partner Program will set you up for success. Join for free and access educational resources, developer preview environments, and recurring revenue share opportunities.
Many shipping apps function as aggregators for multiple shipping carriers in order to offer merchants rate-shopping functionalities. To avoid poor responsiveness of your shipping app, this dependency on carriers’ backed performance should be reduced when possible. We recommend storing carrier retail rates internally to avoid any external call.
For carrier rates that are highly dynamic or merchant-specific, there may be an opportunity to build a caching layer. While not every call to a given carrier will result in the same response, there will likely be a pattern for which rates are identical. Based on this, you can define a cache key. At Shopify, we built a self-healing caching system to significantly reduce the number of external calls and our dependence on shipping carriers’ backend systems.
We recommend following these steps:
In action, these steps look like the following:
Input
Output
postal_codes and a given total weight, every request returns identical shipping rates #{carrier_name}_#{origin_postal_code}_#{destination_postal_code}_#{total_items_weight} => shopify_post_C3C3C3_K2K2K2_1
If calls to external systems such as carriers cannot be avoided through local storage of public retail rates or caching, you can reduce the response time of your shipping app by calling carriers in parallel. Parallelization in combination with a timeout for slow carriers can be very effective in speeding up your response to Shopify while ensuring checkouts are not blocked as a subset of rates are returned.
If your shipping app fetches rates from multiple external systems and you are parallelizing these calls, your app’s response time to Shopify will be at least as long as the slowest response time. To avoid a timeout and a blocked checkout on Shopify’s side, we recommend setting an internal timeout that cancels your request to the external system if it fails to respond. Following this approach, you’ll be able to return to Shopify a subset of rates and unblock checkout.
The response time of your shipping app matters due to the impact it has on customers’ experience at checkout and, therefore, on merchants’ success. A share of the response time can be attributed to the latency between your app server and Shopify servers, which is particularly large when both are located on different continents.
To understand the impact of server hosting on your response time, follow the below steps:
1. Create new file called curl-format.txt with content:
2. Use curl -w "@curl-format.txt" -o /dev/null -s "https://url/" where the URL is the address of one of the Shopify stores your application is installed on. Repeat this step with stores that are located in different regions.
Example output:
Find additional details in curl’s documentation.
The impact of latency varies greatly between regions. Shopify servers are hosted on Google Cloud, for which different levels of latency by region apply as specified in the Google Cloud inter-region latency matrix.
If your connection time is significantly higher than the Google Cloud inter-region latency, consider following the following actions:
To mitigate the risk of blocked checkouts generally and in case of timeouts for external partners specifically, we recommend implementing a backup system for your shipping app (see Shopify backup rates). These rates should be stored in such a way that you can quickly fetch them when external partner requests fail to ensure a successful response to Shopify.
Backup rates don’t need match rates fetched from external sources exactly, but should be sufficiently close to not significantly impact merchants’ profitability and conversion. By analyzing the response data your app is getting from external sources, you should be able to create such relevant rates for your merchants.
Find below an example of backup rates for domestic orders in Canada. Rates differ based on order weight only, but are independent of the specific origin or destination zip code.
We’re aware that in many cases applications may require information from Shopify that is not included in the Carrier Service API payload to calculate accurate shipping rates (such as customer or product tags).
We would appreciate your feedback on what information is missing in the current payload that requires your app to make multiple calls to Shopify to calculate accurate shipping rates. You can provide your answer using this Google Form.
By optimizing your shipping app for performance at checkout, you’re helping merchants boost conversion and make more sales—creating happier and more loyal users for you.
Get design inspiration, development tips, and practical takeaways delivered straight to your inbox.
No charge. Unsubscribe anytime.