coreymckrill / nearby-wordpress-events

A widget to show nearby WP events in the Dashboard
GNU General Public License v2.0
11 stars 4 forks source link

Avoid sending unnecessary API arguments #54

Closed iandunn closed 7 years ago

iandunn commented 7 years ago

When we have a valid location saved, we should only send the latitude and longitude in API requests. The API generates a cache key based on the URL parameters, so including the IP, timezone, and locale basically guarantees that 95% of requests will be a cache-miss.

When we have lat and long values, those are the only things needed to determine the location. Since the lat and long values are the ones we received from the API in the initial request, they'll be standardized across all WP installs for a given search term. That'll ensure that most requests to the API will be a cache-hit, which will drastically reduce load on the servers.

iandunn commented 7 years ago

This is fixed in the merge patch, but we might want to backport it here.

iandunn commented 7 years ago

The merge patch was committed, so there's no need to backport this now.