Problem statement
Wikitech-static (documentation) at https://wikitech-static.wikimedia.org/, exists as read-only backup in case of site-wide outage affecting Wikimedia's production network. At the moment, most of its essential diagrams and other images, are hotlinked from Wikimedia Commons. This means these cannot be accessed offline or independently on Wikitech.
Example: https://wikitech-static.wikimedia.org/wiki/MediaWiki_at_WMF
<img alt="Wikipedia request flow" src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Wikipedia_webrequest_2022.png/266px-Wikipedia_webrequest_2022.png" decoding="async" width="266" height="330" class="mw-file-element" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Wikipedia_webrequest_2022.png/398px-Wikipedia_webrequest_2022.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Wikipedia_webrequest_2022.png/531px-Wikipedia_webrequest_2022.png 2x">
Other information
Wikitech-static uses InstantCommons to include images from Commons, which is powered by ForeignAPIRepo, whereas in production all wikis (incl. Wikitech) use ForeignDBRepo which involved direct MySQL and Swift access to Commons.
By default, MediaWiki core's InstantCommons feature sets ForeignAPIRepo[apiThumbCacheExpiry] = 0 because we prefer letting third-party wikis hotlink over filling up their local disk space. Internally this is implemented by ForeignAPIRepo::canCacheThumbs() with the on-disk TTL determined by fileCacheExpiry which defaults to 30 days (if enabled).
Proposal
Maybe we can enable this on wikitech-static? That way, thumbnails are locally served and cached in most cases. And (to be verified) even if the expiry happens to coincide, InstantCommons should re-use local files if it can't reach the foreign source.