+ /**
+ * Purge the check key for cross-wiki cache entries referencing this page
+ *
+ * @param Title $title
+ */
+ private static function purgeInterwikiCheckKey( Title $title ) {
+ global $wgEnableScaryTranscluding;
+
+ if ( !$wgEnableScaryTranscluding ) {
+ return; // @todo: perhaps this wiki is only used as a *source* for content?
+ }
+
+ DeferredUpdates::addCallableUpdate( function () use ( $title ) {
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+ $cache->resetCheckKey(
+ // Do not include the namespace since there can be multiple aliases to it
+ // due to different namespace text definitions on different wikis. This only
+ // means that some cache invalidations happen that are not strictly needed.
+ $cache->makeGlobalKey( 'interwiki-page', wfWikiID(), $title->getDBkey() )
+ );
+ } );
+ }
+