I use getScript to load dynamically my plugin:
$.getScript(\'js/code.photoswipe.jquery-3.0.4.min.js\', function () {
//do magic
});
Your browser will cache the url accordingly already.. So you don't have to worry about caching.
If however you want to bust the cache simply add a random string to the url like so:
$.getScript('js/code.photoswipe.jquery-3.0.4.min.js?' + Math.random(), function () {
//do magic
});
?' + Math.random() will allow for a random number to append to your js file so caching is broken with each request for the file (as it randomly generates a number)