Faster API Response Times By Limiting Reviews and Offers

I’m exploring the different ways to speed up API response times with the CityGrid APIs. The APIs are fast, and I’ve built several local directories and business search tools that use the API in real-time, with great results. But speed is something that CityGrid engineers and publishers are concerned with, so I will continually explore ways that I can speed of API round trip times (RTT).

Couple days ago I talked about better round trip times with GZip, and today I’d like to talk about enhancing response times by limiting reviews and offers. Generally reviews or offers takes about 20ms each to run (but can occasionally take 50 or 100ms). Since we request reviews, offers, and content (like editorials, website link, menu link, images, etc.) in parallel, the caller only pays for the max of the 3 times with each CityGrid Places API calls. So if the times are like this:

  • Content=12ms
  • Reviews=20ms
  • Offers=22ms

The total time used is 22ms. The place where this can be a real problem, is if reviews or offers times out. Currently the timeout on these services is 400ms (to be reduced to 100ms in the future). So if you are really wanting to improve the RTT and minimize latency you can disable reviews/offers using the following two parameters: review_count=0 and offer_count-=0. This will take the llatency and time-out of those services out of the equation.

So if you are just wanting the core places content and will not need the reviews or offers, you can significantly reduce the payload by disabling these upon request from the CityGrid Places API.

/ / / /