Skip to content
Snippets Groups Projects
Commit 8977ed2c authored by Alex Reisner's avatar Alex Reisner
Browse files

Add README section about geocoding performance.

parent 4d61da2f
No related branches found
No related tags found
No related merge requests found
......@@ -1128,6 +1128,16 @@ A lot of debugging time can be saved by understanding how Geocoder works with Ac
* using the `pluck` method (selects only a single column)
* specifying another model through `includes` (selects columns from other tables)
### Geocoding is Slow
With most lookups, addresses are translated into coordinates via an API that must be accessed through the Internet. These requests are subject to the same bandwidth constraints as every other HTTP request, and will vary in speed depending on network conditions. Furthermore, many of the services supported by Geocoder are free and thus very popular. Often they cannot keep up with demand and their response times become quite bad.
If your application requires quick geocoding responses you will probably need to pay for a non-free service, or--if you're doing IP address geocoding--use a lookup that doesn't require an external (network-accessed) service.
For IP address lookups in Rails applications, it is generally NOT a good idea to run `request.location` during a synchronous page load without understanding the speed/behavior of your configured lookup. If the lookup becomes slow, so will your website.
For the most part, the speed of geocoding requests has little to do with the Geocoder gem. Please take the time to learn about your configured lookup (links to documentation are provided above) before posting performance-related issues.
### Unexpected Responses from Geocoding Services
Take a look at the server's raw response. You can do this by getting the request URL in an app console:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment