I have written a bit of code that helps with versioning of js files. Essentially it spins around the current script manager and appends the javascript file path with an md5
Avoid to invent the wheel twice by using Combres instead. Does everything you ask for, and more!