It would be great it the module provided an option to not use geoplugin.net service as it often causes the biggest, by far, performance hit when loading pages. GeoIP.dat file is availble for a free download from MaxMind so could we perhaps have this module (optionally) use a local file instead of a 3rd-party service?

CommentFileSizeAuthor
#7 cookiecontrol-geoip.patch2.86 KBsnufkin

Comments

pwhite’s picture

I would second this, the performance recently has been a big problem on some of my sites.

I've been commenting out line 63 of cookiecontrol.module as a quick fix.

//drupal_add_js('https://www.geoplugin.net/javascript.gp', array('type' => 'external'));

lethallynx’s picture

I would 3rd this, it's defiantly slowing page load times and it accesses the service every damn page.

Even if the module could cache the results for a specific IP and reuse them.

budda’s picture

Download the data locally could be automated in a similar way that the drupal google analytics module does it, and stores it in the files/ folder for a while.

i'm open to patches for this.

I have noticed the geo server does slow down every now and then.

budda’s picture

if you just set your country list to be empty then no geo js will be loaded anyway.

lethallynx’s picture

Yeah but if you want to actually just limit to countries that require it, then you need to use the field.

budda’s picture

my suggestion was just instead of commenting out module code for now.

I'm hoping somebody has time to submit a patch to cache the geo data locally like GAnalytics module does. Fingers crossed.

snufkin’s picture

Issue summary: View changes
Status: Active » Needs work
StatusFileSize
new2.86 KB

Here is my take on a possible geoip support. The patch does not introduce geoip as a dependency but instead adds an admin setting, which is only enabled when the module is available. Once the admin setting is turned on to use the module, that API will be used instead of geoplugin.

snufkin’s picture

Title: (Optionally) use local geoip database file instead of geoplugin.net for improved performance » Add GeoIP API support for local storage and alternative geoip support