web / lib/services/geocoding/cache-manager
lib/services/geocoding/cache-manager
Manages the caching layer for the geocoding service.
This class is responsible for all interactions with the geocoding cache. Its primary
purpose is to reduce redundant API calls to external geocoding providers by storing
and retrieving results from a local database collection (location-cache).
Key functionalities include:
- Retrieving a cached geocoding result for a given address.
- Storing a new geocoding result in the cache.
- Handling cache expiration and cleanup of old entries.
- Normalizing addresses to improve cache hit rates.
Classes
CacheManager
Constructors
Constructor
new CacheManager(
payload,settings):CacheManager
Parameters
payload
BasePayload
settings
null | GeocodingSettings
Returns
Methods
getCachedResult()
getCachedResult(
address):Promise<null|GeocodingResult>
Parameters
address
string
Returns
Promise<null | GeocodingResult>
cacheResult()
cacheResult(
address,result):Promise<void>
Parameters
address
string
result
Returns
Promise<void>
cleanupCache()
cleanupCache():
Promise<void>
Returns
Promise<void>
Last updated on