In order to enable using an open source service like [[ http://thumbor.org/ | 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:
https://upload.wikimedia.org/wikipedia/commons/thumb/6a6d34da5123a23243dab9787af39eaba1120d06/3738/2912/image/jpeg/500/390/Louis_Armstrong_restored.jpg
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.
For example: https://upload.wikimedia.org/wikipedia/commons/thumb/6a6d34da5123a23243dab9787af39eaba1120d06/3738/2912/image/jpeg/500/390/Louis_Armstrong_restored.jpg?qlow
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 [[ https://gerrit.wikimedia.org/r/#/c/235020/ | here ]]), just to calculate the original/thumbnail size ratio, which is very wasteful.