fix cache behaviour and handle shims version ranges in wired-in packages