# Geocode offline

Source: https://developer.avalara.com/products/communications/integration-guides/communications-integration/udx9560856802969/

Guide: Communications

# Geocode offline

Learn how to handle offline geocoding requests and manage dropped connections effectively.

AFC Geo REST v2 is offline. It can be offline either apart from Communications REST v2 or at the same time. Similar principals apply to AFC Geo requests:

1.  Detect the dropped connection and prevent a crash.
2.  Retry the request or fall back to saved geocoding results.

[Detect the dropped connection](https://developer.avalara.com/communications-integration/calculate-taxes-offline/detect-dropped-connection/) in the same way as you do for a tax calculation.

After your application detects a timeout or an error, it must next decide whether to retry the request or fall back to saved geocoding results.

## Retry a request

Learn how to retry a request effectively to handle timeouts and connection disruptions.

Retry your request a few times if timeouts are still being returned:

1.  Retry the request.
2.  Wait 1 second and retry the request.
3.  Wait several seconds and retry the request.

It’s important that you don’t retry so often that your attempts are mistaken as a denial-of-service attack. Limit your retries to 5 to 10 attempts to prevent a backlog of concurrent requests and allow the system time to recover.

Some applications attempt to reuse HTTP connections. If you experience a connection disruption, we suggest creating a new connection for the next attempt.

## Fall back to saved geocoding results

Understand how to use saved geocoding results during timeouts or errors.

Save geocoding results quarterly by running processing addresses or latitude/longitude coordinate pairs that cover your business needs (such as all new customer data received within the last 3 months). In the event of a timeout or other type of error, fall back to these saved results.

Things to consider when falling back to saved geocoding results:

-   AFC Geo is updated on an off-quarter cycle. Map data and special tax jurisdictions are only updated during this quarterly release.
-   PCode and other characteristics of a location don’t change often, if at all, once the data has been set.
-   Special tax jurisdictions may be added or removed from a primary jurisdiction during a quarterly release based on the local jurisdiction legislation.