Skip to content

Commit ea0f963

Browse files
committed
add cache busting to preloads phetsims/chipper#755
1 parent 4cb06f3 commit ea0f963

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

equality-explorer_en.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1"/>
88
<meta name="apple-mobile-web-app-capable" content="yes">
99
<meta name="phet-sim-level" content="development">
10-
10+
1111
<title>equality-explorer</title>
1212
</head>
1313

@@ -29,6 +29,10 @@
2929
const brandMatch = location.search.match( /brand=([^&]+)/ );
3030
const brand = brandMatch ? decodeURIComponent( brandMatch[ 1 ] ) : 'adapted-from-phet';
3131

32+
// matches "cacheBust" at the start of the string, as well as directly after "?" or "&"
33+
const cacheBust = /(^|\?|&)cacheBust/.test( location.search );
34+
const queryAppend = cacheBust ? `?bust=${Date.now()}` : '';
35+
3236
// Preloads, with more included for phet-io brand
3337
let preloads = [
3438
'../joist/js/splash.js',
@@ -67,7 +71,7 @@
6771
script.setAttribute( 'data-main', main );
6872
}
6973
script.type = 'text/javascript';
70-
script.src = preloadURL;
74+
script.src = preloadURL + queryAppend;
7175
script.async = false;
7276
document.head.appendChild( script );
7377
};

0 commit comments

Comments
 (0)