Last modified: 2011-09-20 17:40:45 UTC
r52460 introduced a local cache which could -- in a long-running script -- pollute the information the script is using if a user happens to be renamed while it's running. We may want to consider adding a new MW_ constant like MW_COMPILED set in the context of a long-running script which would be polluted by caches meant to make requests more efficient. And caching code such as that would disable itself in such a situation.
That sort of temporary cache (which cannot be cleared by other processes making updates) is probably best done in a very explicit way, such as how LinkBatch and friends are used to batch multiple title lookups. By explicitly creating and discarding the cache / batch lookup, the calling code is able to declare that it's starting an operation, fit its lookups within a limited time/space, and explicitly disavow it when done so any future operations that do similar things can restart from the then-current database state.