File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 157157 splashReset .onclick = function () {
158158 splashReset .disabled = true ;
159159 function hardRefresh () {
160- var search = location .search .replace (/ [?&] nocache=\d + / , ' ' );
161- location .replace (location .pathname + search + (search ? ' &' : ' ?' ) + ' nocache=' + Math .floor (Math .random () * 100000 ));
160+ var search = location .search .replace (/ [?&] nocache=[\d. ] + (?=$ | &)/ , ' ' );
161+ // This is a functional cookie used so that we respond with Clear-Site-Data just once. No tracking.
162+ // Can't use nocache parameter to trigger this because people might accidentally bookmark that, and
163+ // then we would be clearing their cache on every visit.
164+ document .cookie = ' tw_clear_cache_once=1; max-age=60; path=/; samesite=strict; secure' ;
165+ location .replace (location .pathname + search + (search ? ' &' : ' ?' ) + ' nocache=' + Math .floor (Math .random () * 10000000 ));
162166 }
163167 if (' serviceWorker' in navigator ) {
164168 setTimeout (hardRefresh, 5000 );
You can’t perform that action at this time.
0 commit comments