I have a .NET MVC 5 website that is hosted as a Windows Azure Website. The site has several large JavaScript files that I would like to cache to the client. I would like the client to only download the JavaScript files on the first load and if the file is updated (cache for infinite length of time). It would be nice if the cache persisted through a re-publish of the website as long as the JavaScript file didn't change.
Is this something that is configured in the MVC project or at the Azure Portal? How do I make it happen? How can I verify that it is actually caching?
Currently I bundle the JavaScript files (into several bundles) in the App_Start\BundleConfig.cs file, for example:
bundles.Add(new ScriptBundle("~/bundles/CustomerPortal").Include("~/Scripts/CustomerPortal.js"));
I then add the script to my view like so:
@Scripts.Render("~/bundles/CustomerPortal")
I am willing to host the JavaScript files elsewhere or in a different method if that is the best way to accomplish this.