Geolocation provider changes
For quite some time Episerver CMS has come with built-in Geolocation support for MaxMind’s GeoLite database. When creating a site using the Episerver CMS Visual Studio Extension or the EPiServer.CMS NuGet package it would come with a recent version of this database included.
But as of late, MaxMind has announced that they are discontinuing the GeoLite database format effective January 2, 2019 and that the database will no longer be updated as of April 1, 2018.
As a replacement, MaxMind is instead offering the free GeoLite2 or the commercial GeoIP2 database which both comes with IPv6 support. These databases do however use a different format than the legacy GeoLite database that’s not compatible with the Geolocation provider included in the current version of Episerver CMS.
For a while, it has been possible to add support for GeoLite2 databases by replacing the built-in Geolocation provider with an excellent third-party provider available from the Episerver NuGet server, written by Khurram Khan, one of our brilliant MVPs.
With the GeoLite support officially coming to an end it no longer makes sense to continue providing the same default Geolocation support. We have therefore decided to make the following changes.
A new provider for GeoLite2 databases
A new separate NuGet package called EPiServer.Personalization.MaxMindGeolocation has been released. This package includes a Geolocation provider with support for MaxMind’s GeoLite2 database and it effectively works as a direct replacement for the provider from the PixieEPiServerExtensionMaxMindGeoIP2 package but with the added support from Episerver. This support is currently limited to usage with MaxMind’s free GeoLite2 City or Country databases, but the commercial GeoIP2 databases should also work although this has not been verified.
This provider needs to be installed separately as the EPiServer CMS package does not have a dependency to it. The Geolocation database can be downloaded from MaxMind’s website directly. To ensure that an updated list of locations is used, the provider also requires the matching CSV file which includes a list of all locations contained in the database. Make sure you specify the path of both the database and the locations file in your configuration such as:
<geolocation defaultProvider="maxmind2">
<providers>
<add name="maxmind2"
type="EPiServer.Personalization.MaxMindGeolocationProvider, EPiServer.Personalization.MaxMindGeolocation"
databaseFileName="path\to\GeoLite2-City.mmdb"
locationsFileName="path\to\GeoLite2-City-Locations-en.csv" />
</providers>
</geolocation>
The paths can be either relative to the website root or absolute.
You can alternatively configure the provider in the ConfigureContainer method of an initialization module that implements IConfigurableModule.
public void ConfigureContainer(ServiceConfigurationContext context)
{
context.Services.AddMaxMindGeolocationProvider("path\to\geolite2-country.mmdb", "path\to\geolite2-country-locations-en.csv");
}
Note that the names of some regions have changed compared to the old GeoLite database, so if you are using the Geographic Location Visitor Group Criterion down to this level, you may have to update these with the new names.
Use geolocation provided by the CDN
We have also added support for retrieving Geolocation from the current request when provided from the CDN in the form of a header with a country code. Due to its nature, it's limited to Continent and Country location and will only be used for sites that don't have a Geolocation provider configured. This support will be turned on by default for all DXC customers. See Content Delivery Network (CDN) Configuration for additional information on how to enable this option.
Phasing out the old GeoLite provider
The old Geolocation provider currently included in the EPiServer.ApplicationModules assembly inside the EPiServer.Framework package will be obsoleted immediately and removed in a future major release. The EPiServer.CMS package will still contain the legacy GeoLite database for a while longer as removing it would remove it from existing solutions when updating the NuGet package. Once the provider has been fully deprecated, we will remove the database as well.
New sites created using the Episerver CMS Visual Studio Extension will be configured without a Geolocation provider going forward.
If you have any questions in relation to these changes, please comment below or send your question to our support team.
Comments