chore(geocoder): enable caching for geocoder
This commit is contained in:
parent
04f429abef
commit
01aaec6e90
1 changed files with 7 additions and 1 deletions
|
@ -1 +1,7 @@
|
||||||
Geocoder.configure(lookup: :ban_data_gouv_fr, use_https: true)
|
cache_configuration = if ENV['REDIS_CACHE_URL'].present?
|
||||||
|
{ cache: Redis.new(url: ENV['REDIS_CACHE_URL']), cache_options: { prefix: "geocoder:", expiration: 6.hours } }
|
||||||
|
else
|
||||||
|
{ cache: Geocoder::CacheStore::Generic.new(Rails.cache, { prefix: "geocoder:" }) } # generic has no specific expiration support as of geocoder 1.8
|
||||||
|
end
|
||||||
|
|
||||||
|
Geocoder.configure(lookup: :ban_data_gouv_fr, use_https: true, **cache_configuration)
|
||||||
|
|
Loading…
Reference in a new issue