A very common way is to use a parameter in the url of the file
<script src="/scripts/archivo.js?v=1"></script>
In the final part of the url is added a querystring , when you do a deployment now what you would have to do is change the number (any number or text works), in this way you take advantage of the cache and when you deploy a new version users will not have to manually clean yours, simply reload the page.
That's the basic strategy, but if you use the feature of < strong> union and minification of ASP.NET MVC, the framework handles the parameter automatically for you:
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery")
.Include("~/Scripts/jquery-{version}.js"));
// el resto de tus scripts...
BundleTable.EnableOptimizations = true;
}
EnableOptimizations
is what causes the parameter to be added, the framework calculates the hash of the file, so when the content changes, the parameter changes. In the view you include them for example:
@Scripts.Render("~/bundles/jquery")
The default template of MVC5 includes the example of how to use this framework feature, you can review it there.