Last modified: 2014-05-08 19:22:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59126, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57126 - Provide a JavaScript API for geoip lookups
Provide a JavaScript API for geoip lookups
Status: NEW
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
wmf-deployment
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-16 00:57 UTC by Ori Livneh
Modified: 2014-05-08 19:22 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ori Livneh 2013-11-16 00:57:54 UTC
There is code in several extensions (WikimediaShopLink, UniversalLanguageSelector, CentralNotice) for loading <https://bits.wikimedia.org/geoiplookup> and <https://geoiplookup.wikimedia.org/>.

This exceeds the scope of what extensions are entitled to determine, in my opinion, since access to GeoIP look-ups has monetary, legal & performance implications (the latter because it is often used in a manner that adds a request to each page load).

GeoIP lookups should be wrapped by a JavaScript API that de-duplicates / caches lookups. The API should make it possible to apply limits to GeoIP usage that are enforced across all extensions.
Comment 1 Faidon Liambotis 2013-11-16 01:13:56 UTC
Thanks Ori, I'm excited to see progress in this area.

From our (techops) side I have two requests for this common API:
a) Identify what exactly is it that we need from GeoIP; we currently provide alot of information, including city, lat long as well as a netmask that we had to hardcode to 24 (i.e. useless) due to performance issues with libgeoip (cf. https://gerrit.wikimedia.org/r/#/c/34280/). I couldn't identify any code that actually used anything but country from my cursory lookup.

b) Deprecate the bits.wikimedia.org/geoiplookup URL and rely solely on geoiplookup.wikimedia.org. As a reminder, the reason that we used a separate top-level domain is that IPv6 city databases are non-existent, so we have to force users to use IPv4 by using a separate domain; depending on (a), we might not need this anymore, but having a separate domain gives us more possibilities, so let's keep that.

Additionally, note that depending on the use case, it might be possible to do some GeoIP lookups on the Varnish layer but instead of serving JSON, tagging regular requests to MediaWiki with a custom header that it can be then Vary-ed on. It looks possible we e.g. might going to end up doing that for CentralAuth.

Finally -and this falls outside of ops- it might be helpful to look at MaxMind's own Javascript API ( http://www.maxmind.com/en/javascript ) for ideas on what could be implemented in ours from an API perspective.
Comment 2 MZMcBride 2013-12-12 20:04:47 UTC
(In reply to comment #1)
> b) Deprecate the bits.wikimedia.org/geoiplookup URL and rely solely on
> geoiplookup.wikimedia.org. As a reminder, the reason that we used a separate
> top-level domain is that IPv6 city databases are non-existent, so we have to
> force users to use IPv4 by using a separate domain; depending on (a), we
> might not need this anymore, but having a separate domain gives us more
> possibilities, so let's keep that.

Bug 55907 comment 2 and documentation ([[wikitech:geoiplookup]] && [[m:geoiplookup]]) suggest that geoiplookup.wikimedia.org is deprecated in favor of bits.wikimedia.org/geoiplookup.

If geoiplookup.wikimedia.org is going to be un-deprecated, we'll need to make sure that developers are aware and that the relevant documentation is updated.
Comment 3 Niklas Laxström 2014-01-24 21:27:33 UTC
ULS uses the country information for language selection suggestions on the frontend.

We use the information that is already loaded on WMF sites (except for third parties where we add a call to retrieve that info), but it could potentially be delayed until click, but it would add to the delay of showing the language selector widget for the first time.
Comment 4 Derk-Jan Hartman 2014-04-14 09:47:37 UTC
This is also used by English Wikipedia Geonotices:

https://en.wikipedia.org/wiki/Wikipedia:Geonotice

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links