As part of T124713 I made two patches: one for today (present), one for tomorrow (future)
Here is a link to the second patch: https://gerrit.wikimedia.org/r/266972
Let's track this work as a technical research task.
Most of the work is done, but before approving it and merging it we need more review and testing.