Who adds numbers to the query portion of the URL of a css background-image?

Solution 1:

What component adds that string?

That string is a hash of the contents of the file, and is added by MediaWiki's ResourceLoader component. Specifically, ResourceLoader.php on the backend and mediawiki.loader.js on the frontend.

How can I determine this string myself?

ResourceLoader is using the FNV 1 32-bit hash function, so you could always compute the same function (the two source files above each contain an implementation, one in PHP and one in Javascript).

The normal way to handle something like this is to to use a CSS preprocessor. That way you can refer to the unversioned name in your source CSS file, and then have the processor substitute the correct versioned name automatically. I'm not sure the best way to do this with MediaWiki specifically.

How can I turn off this adding of the string, since I need to issue a preload for this file?

ResourceLoader has configuration options, but I don't see a straightforward way to turn this off. Given the complexity of the ResourceLoader architecture, and the fact that it was designed to improve overall performance, it seems unlikely to be worth the effort to try and disable this feature.