Not all caches will cache content using the query string.
Steve Souders recommends: "... avoid requesting cached resources." He found that in this case 5-20% of requests would not be cached. Query strings, in particular, do not work at all with some CDNs for cache invalidation.
The best way is to create MD5 with a javascript file name for each release, for example.
{path to script file}/filename-{md5 hash}.js