// Start of Version Checking in the head section of the page. // Place this code on each page and only update the version number of a page if the page has changed. const currentVersion = '1.2'; // Set this to the current version of your page // Check if the user has a stored version const storedVersion = localStorage.getItem('pageVersion'); // If no version is stored (first visit), or if the stored version doesn't match the current one if (!storedVersion || storedVersion !== currentVersion) { // Set the current version in local storage localStorage.setItem('pageVersion', currentVersion); // If they had an older version, reload the page if (storedVersion) { location.reload(true); // Forces reload from the server } } else { // If versions match, allow the page to load from cache console.log('Page is up to date, no refresh needed.'); } // End of Version checking in head section of page.