I am coding a MVC 5 internet application and have a question in regards to JavaScript caching (and caching in general).
Currently, when I update a JavaScript file that is referenced in a view, when I browse to the view, the old JavaScript code is used. If I then refresh the browser, the updated JavaScript code is then used.
This is not ideal, as a user may often browse to a view that has an old JavaScript file, and as such, the view may not be displayed correctly.
I am currently referencing JavaScript files as follows:
@section Scripts{
<script src="~/Scripts/filename.js"></script>
}
Is there a web.config setting that controls caching? Is there a NuGet package that can help with caching?
How can I resolve this situation?