Right now our top-queue stylesheets load without a version parameter, and thus are not cached for long.
This is the case because our page output is cached for upto 30 days and in order to allow rapid deployment following ResourceLoader's design we mustn't hardcode version numbers in the page html.
Instead we have a module metadata manifest. Our top and bottom queue for javascript bundles uses this to form the url for the load request. However the stylesheet request must not depend on JavaScript and as-such can't reference those version number.
The only way around this in the current set-up would be to embed the version with ESI. However that's not currently supported and while ResourceLoader has ESI logic in place for some methods, it doesn't for this one.
Roan (@Catrope) and I have considered doing the request in JavaScript and then falling back to an unversioned one (like now) inside <noscript>.
We did some research in browser support for <link rel=stylesheet> inside noscript in 2011 and concluded that it's supported everywhere except in Opera 11.0. It worked in Opera 10, and the regression was fixed in Opera 11.10. Opera 12 also supported it fine. After Opera 12, Opera switched to Chromium (with the Opera 15 release). So the Opera 12.x legacy branch supports it fine.
Previous comments about this:
- T54718#578731 at T54718: ResourceLoader: Module loaded with addModules should load CSS even when JavaScript is disabled
- T31308#323116 at T31308: Implement ParserOutput::addModuleStyles
See also: