Encountering a recurring issue where changes made to CSS or Javascript files do not reflect in client browsers unless they manually refresh the page with ctrl+F5. This poses a challenge, especially in a school system with numerous users who may not be aware of when updates are made and how to refresh their browsers.
Research suggests appending a version number like "java.js?v=1.0" at the end of the file to address this caching problem. However, implementing this solution within bundling has proven tricky. Adding the version parameter in the .cs config file leads to missing references after deployment.
Here's an example of bundled files:
bundles.Add(new ScriptBundle("~/bundles/utilitiesJs").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery.dynatable.js",
"~/Scripts/js-cookie.js",
"~/Scripts/bootstrap.js",
"~/Scripts/bootstrap-multiselect.js",
"~/Scripts/bootstrap-toolkit.min.js",
"~/Scripts/common.js?v=1.0",
"~/Scripts/dropdown.js?v=1.0",
"~/Scripts/waitingFor.js",
"~/Scripts/analytics.js"));
While I've added "?v=1.0" to common.js and dropdown.js, these files are mysteriously absent in the Page Source post-deployment:
<script src="/DMC/Scripts/jquery-3.1.1.js"></script>
<script src="/DMC/Scripts/jquery.dynatable.js"></script>
<script src="/DMC/Scripts/js-cookie.js"></script>
<script src="/DMC/Scripts/bootstrap.js"></script>
<script src="/DMC/Scripts/bootstrap-multiselect.js"></script>
<script src="/DMC/Scripts/bootstrap-toolkit.min.js"></script>
<script src="/DMC/Scripts/waitingFor.js"></script>
<script src="/DMC/Scripts/analytics.js"></script>
If anyone can shed light on what might be going wrong here, whether it involves renaming the common and dropdown files or another approach entirely, your assistance would be greatly appreciated!