Ensure Users Are Running Latest JavaScript
Overview
What Is It?
When making JavaScript changes, ensure the changes are placed in a new filename. The current naming standard is basename_YYYYMMDD.js
.
Browsers, by default, attempt to cache JavaScript and stylesheet files. As we change JavaScript to support new features, it is important that the latest JavaScript is downloaded to the users' browser. Since our users can be on their own computers, we can’t force a clearing of their browser cache.
By deploying new names for each changed JavaScript file, the browser sees these as new files and downloads them.
How Does It Work?
The header specifies a new framework file so the browser downloads it and caches the new version. The framework specifies new names for the base JavaScript files so the browser downloads those as well. The user's browser is always running your latest JavaScript code.
Administration
Component 1: Base JavaScript Files
Component 2: JavaScript Framework
Notes
- During the release, any future changes to the base files won’t automatically download since the new release date versions are cached for your development team. The development team needs to force a cache refresh. This will not be the case for your production users as the final version will be released at go live.
- You can periodically delete older versions of your JavaScript files.