This proposal is a first step to fix
The scope of
XWIKI-6073 is large and requires a lot of changes. We will probably need to break some APIs. It's too much work for the 7.x cycle.
But we could at least, without breaking any API, add the version of the document holding some skin extensions, in the query string of the URL generated by $xwiki.ssx.use() and $xwiki.jsx.use().
That would fix a lot of issues, even if it's not the ideal fix.