Description
Wikifunctions will have its content available in many different language, similar to Wikidata. Unlike Wikidata, we will have unique URLs for each language. E.g. www.wikifunctions.org/wiki/fr/Z6 would give the page about the object Z6 in French, www.wikifunctions.org/wiki/ar/Z6 in Arab, etc.
We need to ensure that this works reasonably well with Caching. The pages are client-side-rendered, and are going to be (relatively) few in number.
More details are described here: T268678
Preview environment
We want to check with which implementation of our requirements to proceed before doing it. Therefore the URL scheme is not yet implemented and set up. Individual pages in several languages though are already available.
E.g. this is the implementation of add s to end in English and in German:
- https://wikifunctions.beta.wmflabs.org/wiki/Z10212?uselang=en
- https://wikifunctions.beta.wmflabs.org/wiki/Z10212?uselang=de
Which code to review
The code for the Wikilambda extension which will run Wikifunctions is available here:
https://gerrit.wikimedia.org/g/mediawiki/extensions/WikiLambda
Particularly interesting is the current WIP:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/925927/ – the uselang flag is set on incoming requests using the PathRouter class built into MediaWiki, with some link re-writing as needed.
Performance assessment
Please initiate the performance assessment by answering the below:
- What work has been done to ensure the best possible performance of the feature?
Used MediaWiki's i18n framework as far as possible.
- What are likely to be the weak areas (e.g. bottlenecks) of the code in terms of performance?
How much can be cached, how much do we split the cache?
- Are there potential optimisations that haven't been performed yet?
We could potentially save content fragments and update them asynchronously. This conversation is being lead by James Forrester.
- Please list which performance measurements are in place for the feature and/or what you've measured ad-hoc so far. If you are unsure what to measure, ask the Performance Team for advice: performance-team@wikimedia.org.
One assumption we have is that Wikifunctions will trail our popular projects in popularity for quite a while (i.e. there won't be that many people coming to Wikifunctions at first). This will allow us to observe how Wikifunctions acts under realistic loads, and we will be able to implement changes that make us more robust with regards to growth when necessary. It would be good to know if we need to have any specific metrics in place in order to collect the right data to support future scaling.
We are asking for advice on how to implement the i18n mechanism in a way that doesn't break caching.