Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] What to do if we don't need the 'city' database ? #268

Open
BenStirrup opened this issue Jul 6, 2024 · 4 comments
Open

[Request] What to do if we don't need the 'city' database ? #268

BenStirrup opened this issue Jul 6, 2024 · 4 comments

Comments

@BenStirrup
Copy link

Hello all,

Our use case only involves the use of the country data from an ip. Example :

const country = lookup(ip).country

We don't even need to query or download the cities database.

@bluesmoon would there be a good way to go about it ?

@bluesmoon
Copy link
Collaborator

honestly, I'm a bit rusty on this. I think it should be possible to run without a city database, I just don't remember how.

@sapics
Copy link

sapics commented Sep 8, 2024

I have created ip-location-api which has similar in-memory database system with geoip-lite.
In ip-location-api, we can customize fields to display and the default field is only country which matches your requirements, I guess.

@shiv-source
Copy link

@BenStirrup After thoroughly reviewing the code, it appears that the package, as it currently stands, is not capable of adapting to the specific settings you're trying to configure. Regardless of whether you need certain properties or not, the package caches the MaxMind data at initialization, which can be unnecessarily resource-intensive.

To achieve better performance and flexibility, the package's internal architecture would need to be revised. Specifically, it should support selective caching, allowing only essential data to be loaded based on configuration, rather than defaulting to cache everything. This would prevent the overhead associated with caching MaxMind's heavy datasets when they aren't needed.

@bluesmoon
Copy link
Collaborator

patches welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants