In order to enable using an open source service like Thumbor (see T110858), the current wikimedia thumbnail URL scheme needs to change.
I suggest the following:
https://upload.wikimedia.org/wikipedia/<wiki>/thumb/<sha1_of_original>/<width_of_original>/<height_of_original>/<thumbnail_mime_type>/<thumbnail_width>/<thumbnail_height>/<title>
An example would be:
Original file dimensions are needed because Varnish needs to have JPG sharpening logic - which is dependent on original/thumb size ratio - in order to be able to hit Thumbor directly without relying on mediawiki.
Title and revision are only provided for human-readability. The downside being that title renaming will bust viewers' cache needlessly. But this is a rare occurrence and shouldn't matter much.
Note that I am not getting into multipage thumbnails, or the wp-zero quality parameter yet. The initial goal is to get simple JPG and PNG thumbnailing working (91% of our files). Thumbor doesn't support multipage documents anyway. I think these options, which are variations on the default thumbnail, should be taken care of by optional GET parameters anyway.
The biggest advantage to working on that new URL scheme is that it allows us to serve thumbnails through the old swift/mediawiki architecture as well as through thumbor at the same time.
Without this new URL scheme, using Thumbor would require always going through Mediawiki (like in my patch here), just to calculate the original/thumbnail size ratio, which is very wasteful.