geocoder icon indicating copy to clipboard operation
geocoder copied to clipboard

feat: Provide better Rails cache store support

Open ixti opened this issue 2 years ago • 1 comments

Current implementation disrespects expiration TTL, polluting redis with non-expirable keys. Proposed solution wraps Rails.cache (configured with :redis_cache_store) with adapter that respects Rails cache semantics.

ixti avatar Jul 03 '23 13:07 ixti

It's also worth to mention in the README that configuration like:

Geocoder.configure(
  cache: ...,
  cache_options: { expiration: 1.week },
  ...
)

Sets prefix to nil, not the default geocoder:. We had configuration like:

cache: Geocoder::CacheStore::Generic.new(Rails.cache, {}),
cache_options: { expiration: 1.week },

As a result we have lots of keys both without prefix and without expiration.

ixti avatar Jul 03 '23 13:07 ixti