Built for Shopify – 500ms limit vs external API

Hi Shopify Community,

We’re currently building an app that leverages the Carrier Service API to calculate shipping costs between two points. Our app integrates with Google’s API to determine the distance, and based on user-defined settings and the calculated distance, we return appropriate shipping rates at checkout.

We’re on track for obtaining the Built for Shopify badge, but we’ve encountered an obstacle: one of Shopify’s requirements specifies a response time under 500ms. Our current response time averages around 631ms, primarily due to the external Google API request. We’ve optimized our side as much as possible, but it seems we’ve hit a hard limit due to this external dependency.

Has anyone faced a similar challenge? What approaches or optimizations could we consider to bring our response times below the 500ms threshold, given the necessity of this external API?

Thanks for any guidance or insights!

Theres a couple of things I would look at here and profile if you can.

Whats the split of latency between your app, Googles API and any other logic.
If you’re using javascript you could add logs with timings, either manuall or there is a performance API.

This will help figure out where you could trim some off as you are so close.
Then would be worth considering any caching you could do, any optimisations to how your API is hosted etc.

Whats the average latency of the google api request? :thinking:

1 Like