MediaUploader registers which templates are used in campaign configs and this allows for campaign config cache invalidation every time a transcluded template is changed (through the LinksUpdate mechanism). This currently does not work for the main global config.
The best I've come up with so far:
- Define a new content type, let's call it MediaUploaderConfig, for a single "magic" page, maybe in a special-purpose namespace.
- It seems that defining an entire new content type won't be needed, we can hook into an existing one, using this hook.
- We probably could try to hack around and make the page impossible to delete, but I'm not sure if it will matter at all. More investigation needed.
- Whenever we detect a global config cache invalidation is necessary, we also enqueue a LinksUpdate for the magic page.
- Have the content type override getParserOutput() and similarly to CampaignContent, use the GlobalParsedConfig::getTemplates() method to register all used templates on the page in the ParserOutput object. This will cause a LinksUpdate for this page whenever any of the transcluded templates are changed.
Drawbacks: complicated and hacky. On the other hand, it mostly uses built-in mechanisms.