Wikimedia Foundation CTO Brion Vibber recently added a very neat feature to the development version of MediaWiki. In order to enable it, all you need is a snippet of code in your LocalSettings.php configuration file:
$wgForeignFileRepos = array(
'class' => 'ForeignAPIRepo',
'name' => 'shared',
'apibase' => 'http://commons.wikimedia.org/w/api.php',
'fetchDescription' => true, // Optional
Your wiki installation will now have full access to Wikimedia Commons in the same way any Wikimedia wiki does. You can embed image thumbnails of any size, and they will be automatically generated and loaded from Commons. You can click images and see the file description (including the wiki description page, file history and EXIF metadata) loaded from Commons. I haven’t tried to make the embeddable video/audio player work yet, but any file type will be accessible.
This is wonderful, because it makes the nearly 3 million freely licensed files in Commons easily accessible to potentially thousands of wiki users, while retaining the critical licensing information. This implementation does not cache the data in the local wiki, so is not yet suitable for large scale installations. Caching the data intelligently is a significant challenge, as it could be a vector for denial of service attacks and also raises the questions how/when cached files should expire, etc. I wrote a proposal called “InstantCommons” a couple of years ago which included some notes on the issue. After an incomplete first implementation of InstantCommons, I’m glad that we now have a working, simple mechanism for third party use of Commons media. Given that the foreign repository can be any MediaWiki installation, it will also be interesting to see what other wiki-to-wiki exchanges might result from it.