kinotto / geonames.js

Nodejs and Browser client for Geonames.org REST API :earth_africa:
http://www.geonames.org/export/client-libraries.html
MIT License
88 stars 17 forks source link

Anyway to cache results? #29

Closed timrchavez closed 3 years ago

timrchavez commented 3 years ago

The app I'm building will most likely reuse the same result sets once they're fetched once. I don't think there's a way to do opaque caching with geoname.js, but it would be super convenient if there was

kinotto commented 3 years ago

Hello @timrchavez i didn't create a cache layer in genomes.js, what you can do is handling it at application level, if you fetch the data once when your process starts than you store it somewhere (a key value pair object, where the key is the api name would be fine) and you prevent subsequent fetching reusing that same dataset. Thank you