Best Strategy for Venue / Search at Foursquare

We strive to use Foursquare as a location database for our application. Their API claims that an application can make up to 5,000 hassle-free requests per hour for endpoints / * endpoints. To reduce the number of requests, they recommend using caching to avoid repeated calls to the Foursquare API when different users request the same information.

For our application, we want to use the location / search endpoint to get validation data around the location. What is the best way to cache this data to ensure the least number of calls in the Foursquare API?

The current idea is to cache kilometers of “boxes” that represent an area on earth. When a user requests neighboring objects, we must call Foursquare from the center of the location point of the window in which they are currently located and cache the results for this field. Now, when another user arrives, if they are in this field, we can return the results that we cached for this window that are closest to the user. If the user is close to the edge of the window, we return the closing results from the window in which they are currently located, as well as the closing results in the adjacent field.

Is this a good way to do everything to limit queries? We fear that this method may use too much memory. How do you do this in your applications? Any ideas would be great, thanks!

+4
source share

All Articles