The advantage of including js on web page is that I need not to worry about cached js file. If I change it on the server, the same will be reflected on client side. But it increases the size and complexity of webpage. It also affects average response time.

But if I make a separate js, so it could be saved at client side on first request, client needs to remove cached js when I do some changes in js at server side.

Is there any way (some HTML tag or attribute) to indicate to the browser that js file has been changed at server side. So it downloads the new copy. Or something like versioning.

This is probably the easiest solution, although I keep hearing reports that certain browsers and proxies don't cache files with query strings in them.
–
DisgruntledGoatJun 15 '11 at 11:53

I am satisfied with @Jason Gennaro and @Bob Baddeley answers. I would like to add one more point which came in my mind after a doubt. If a js is being referred from mass number of webpages then changes on every page would not be possible. In such a case, Create a separate tile/templet/master page which have all common resources and settings. So the changes at one place would be applicable to all places.
–
Amit GuptaJun 15 '11 at 15:46

This is what version numbers are good for. If you include your file with a version number in the file name (like jquery-1-5-1.min.js), then later when a new version of the file is deployed you update with the new version number (like jquery-1-6-0.min.js), then you don't have to worry about the caching.