The m-dot domains at WMF (e.g. "en.m.wikipedia.org") were introduced for reasons and benefits that no longer apply today. As such, its continued existence has been questioned and is under technical re-evaluation since 2019 in RFC: T214998. In addition to its existence adding measurable costs and complexity, there are 5 concrete problems that we would naturally solve if we phase the mobile domain (such as mobile site performance, and technical debt).
I recommend we phase out the mobile domain, in favour of providing the mobile experience directly on our standard URLs. See also #Recommendation.
The current effort started in December 2024, after discovering that Google no longer supports the m-dot concept.
The m-dot domains were introduced in 2008 as an alternative way to browse Wikipedia. The separate domain allowed the proxy service to launch at relatively low risk, by being fully opt-in and separate from our standard "canonical" URLs. Adoption spread socially and externally via marketing, word of mouth, and Google. Some wikis deployed a JavaScript snippet that detected mobile user agents and would forcefully redirect visitors that way.
In 2011, the mobile gateway was shut down in favour of the MobileFrontend extension for MediaWiki. The m-dot domain was repurposed to serve traffic directly from MediaWiki, the same way our standard URLs do. Our CDN takes mobile traffic and adds an internal HTTP header ("X-Subdomain: m"), which instructs MediaWiki/MobileFrontend to apply the mobile layout.
Also in 2011, we made the mobile site the default for mobile visitors. The Wikimedia CDN started redirecting mobile user agents that visit our standard URLs, away to the m-dot version of that URL. This remains how it operates today, as of February 2025.
Google used to maintain and associate both a "mobile" URL and canonical URL with each web page. When searching via the mobile version of Google Search, they would present this "mobile" URL instead of the canonical URL, thus directing visitors there without incurring our redirect.
In short, the following benefits existed in 2008:
Reflecting on this seventeen years later in 2025:
After saving edits in MediaWiki, we send purges to our CDN ("Varnish" and "ATS") to clear the cache of articles for each URL variant. It has been a perennial concern from SRE teams since at least 2016, that our rate of purges is unsustainable. Unifying domains would instantly cut MediaWiki's purge rate by 50% (20% overall, as half still comes from legacy RESTBase). While other ideas to reduce purge load do exist and are worth exploring, those tend to be smaller in impact, or increase complexity, or lower service quality. Domain unification would make the biggest cut, and yet do so at relatively low cost, whilst on the whole reducing operational complexity, and without removing features or lowering quality of service.
Problem 2: Failed UX expectations[edit]Today our redirect goes in one direction only. When people read Wikipedia on mobile, and share articles with friends over instant messaging, or with the public in chat rooms and social media, the mobile URL hardcodes the mobile experience for whomever receives that link. This includes, for example, journalists who link to Wikipedia in their articles. We fail these audiences today, by leading readers into an experience they do not expect or associate with Wikipedia on that device.
A knock-on effect is that, inevitably, a new Wikipedia editor or journalist or celebrity, will be "corrected" by someone who knows this quirk, informing them that they shared the "wrong" link. This wasted energy distracts from what could be a more productive conversation about Wikipedia. It is within our power to simply remove this speedbump.
Problem 3: Google SEO[edit]Google used to support the m-dot concept, with their index having a special place for the "mobile" version of each URL, for websites that have one. When people query Google Search from a mobile device, they would present that link instead of the standard link.
For the ~60% of pageviews referred from Google, Google determined whether a visitor is on mobile, and Google sent them directly to our mobile URL. This nicely avoided a performance penalty in the form of our redirect delaying people's browsers on every mobile page load.
Since early 2024, Google no longer supports m-dot domains. Google now presents the same canonical link to everyone. This has a number of implications:
When analyzing the last two years of performance data (Navigation Timing), there is a clear regression starting in May 2024. Our redirect adds a full round-trip between client and server before a mobile device can start loading an article. Mobile pageviews have gotten slower around the world, with geographies furthest from our data centers affected the most. This is essentially a regressive tax. Solving this would bring us closer to equitable performance, as it will cut the most from those with the slowest experience.
I looked at two metrics:
Summary from data at P73601:
The mobile domain concept is only recognized in our CDN and MobileFrontend. (The CDN generates a redirect, and converts mobile traffic back to a standard URL and forwards it to MediaWiki. MobileFrontend generates the "Mobile view" link, and decides whether to apply the mobile layout on a pageview.)
The 2011 development of MobileFrontend did not include adding support for "mobile URLs" in the MediaWiki platform, nor has this developed since. We have a decade-long trickle of bugs where new products or platform capabilities are (after being deployed to production) found to be broken, corrupt caches, or send users to the wrong experience (e.g. CentralAuth SUL3, OAuth, SecurePoll, ResourceLoader). While these can sometimes be worked around by hardcoding references to MobileFrontend utilities to fix-up the "wrong" URL, there remain long-standing bugs that have no solution or are unprioritized. Full list in the task description atop T214998.
Implementing native support for mobile URLs in MediaWiki, unfortunately, presents a paradox. It would be easy to build an option to return a "mobile" URL in various core APIs. The paradox is in knowing when to call upon that option, as there is no one-size-fits-all solution. There is an inherent ambiguity between the "current", "canonical", and "right" URL for any given consumer. No amount of abstraction or engineering solves this. At best we can create shortcuts that make the current workaround easier to invoke. But, so long as the mobile domain exists, I see no future in which we don't develop, deploy to prod, find breakage, apply workaround, repeat.
MediaWiki is a leader among CMSes in its long-standing adoption of relative URLs, like "/wiki/Banana". Our protocol- and domain-agnostic URLs leverage the browser to automatically resolve these in their current context. This design serves us well, e.g. handling the HTTP/HTTPS migration without a doubling in cache cost (back in 2015), and this is what has allowed the mobile site to work as well as it has with most products and components naturally doing the right thing. However, this doesn't change the fundamental problem when a full URL is needed, e.g. when interacting between two wikis (interwiki links), or between Wikipedia and a third-party site (e.g. OAuth signing an exact URL, or Google Search), as only the caller knows what it needs.
This is not limited to MediaWiki. It is even harder for standalone services and third parties to adopt. For example, the recently viral WikiTok website initially launched with Wikipedia links that served the desktop experience to mobile users.
It is my recommendation that we phase out the mobile domain, in favour of providing the mobile experience directly on our standard URLs. A single standard URL (such as "en.wikipedia.org/wiki/Banana") will transparently and automatically serve the appropriate experience based on whether the user agent is a mobile device.
At this point we pause to test relevant functionality and infrastructure:
Refer to Problems 1-5 for the status quo.
Alternative: CDN purges[edit]The 20% cut in our CDN purge load from the recommended option can only be achieved by phasing out the mobile domain. Per § Problem 1, there are other more expensive options and/or options that make smaller cuts.
Phasing out the mobile domain — in the CDN layer — can be done in two ways. The recommended option phases it out from the public (thus also solving Problems 2-5: UX, Google, Site speed, and Tech debt).
If we wanted to only solve Problem 1 (CDN infra cost), there is one alternative option. We could emulate the proposed solution within our CDN layer, rather than actually doing it for the public.
We currently rewrite mobile requests to standard URLs after the cache lookup. If we were to perform this rewrite (and add a Vary-header) before the cache lookup in Varnish, that would similarly allow us to un-deploy purging of mobile URLs, as the standard URL purge would suffice to match and purge both variants in the cache.
Downside: This would expand the gap between how the CDN appears to work, and how it actually works. Such surprises and onboarding speedbumps add to what every SRE may eventually need to learn and remember. It also adds a cognitive weight to a system that is already complex to reason about; on the contrary, Domain unification would make the system easier to understand.
Alternative: Mobile perf[edit]I'm not aware of other removable redirects or roundtrips in our page load cycle.
I'm not aware of other software changes that could eliminate the current redirect.
One way to speed up latency to servers in general (thus masking the redirect cost, instead of removing it), would be to build more caching data centers in more countries.
Alternative: Tech-debt around mobile domain[edit]I've described under § Problem 5: Tech debt widespread that this is a paradox inherent to having a mobile domain, and that there are marginal gains in how we do the workarounds, but I'm not aware of (other) ways to solve the inefficient develop-deploy-discover-workaround loop.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4