I am planning to use Maxmind’s DAT file to provide some basic geolocation capabilities in an ASP.NET MVC application I’m developing. The DAT file is approximately 17mb and I’m wondering what the best approach would be to load this in my application – obviously I don’t want to load it every time some geographical information is required and am thinking the best course of action is to load it into a shared variable upon application start.
How has anyone else approached this? Any recommendations?
Thanks
JP
Cache is a terrible place to store this. It can get wiped out without notice so you’ll have to re-load it whenever it gets deleted.
Maxmind supplies a .NET API to deal with their DAT file. The one packed as a tar.gz (described as “Open source C# API for GeoIP City, Country, ISP, and more”) already has an option to efficiently load the data into a private cache, e.g.: