Page MenuHomePhabricator

Build the render-time lookup that turns a requested mainspace title into an opt-in entry
Open, MediumPublic

Description

Build the render-time lookup that turns a requested mainspace title into an opt-in entry.

On every mainspace article read the rendering path needs to decide whether the requested title is an opted-in abstract article, and — critically — this decision has to be fast because it sits on every article read on the wiki, not just on reads of opted-in titles. The expected shape is a WANObjectCache (WANCache) -backed lookup of the opt-in set for the wiki: the cache value is the title → QID map derived from the configuration, populated on a cache miss by reading through CommunityConfiguration's normal config-read API, shared across app servers via WANCache, and invalidated across DCs through WANCache's standard multi-DC purge path. Using WANCache rather than a bespoke in-process map buys us the standard WMF correctness properties — tombstoning, holdoff windows after writes, thundering-herd co-ordination — for free, rather than rolling our own layer and discovering those subtleties during incident triage. Cache invalidation is triggered by whatever hook CommunityConfiguration already emits on config change, via a standard WANCache delete against the key; building a parallel invalidation surface is out of scope. A naive implementation that hits the underlying configuration store on every article read, bypassing WANCache, is explicitly not acceptable.