Skip to content

Commit 2ae4c39

Browse files
authored
Merge pull request #120 from aroskanalen/feature/398-cache-busting
Cache busting
2 parents 48d703f + 3a458ed commit 2ae4c39

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- Added cache busting.
8+
79
## [2.0.0] - 2024-04-09
810

911
- [#119](https://github.com/os2display/display-client/pull/119)

src/app.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,14 @@ function App() {
271271
if (releaseTimestampRef?.current === null) {
272272
releaseTimestampRef.current = config.releaseTimestamp;
273273
} else if (releaseTimestampRef?.current !== config.releaseTimestamp) {
274-
window.location.reload(false);
274+
const redirectUrl = new URL(window.location.href);
275+
redirectUrl.searchParams.set(
276+
'releaseTimestamp',
277+
config.releaseTimestamp
278+
);
279+
redirectUrl.searchParams.set('releaseVersion', config.releaseVersion);
280+
281+
window.location.replace(redirectUrl);
275282
}
276283
});
277284
};
@@ -290,7 +297,7 @@ function App() {
290297
const handleKeyboard = ({ repeat, metaKey, ctrlKey, code }) => {
291298
if (!repeat && (metaKey || ctrlKey) && code === 'KeyI') {
292299
localStorage.clear();
293-
window.location.reload(false);
300+
window.location.reload();
294301
}
295302
};
296303

0 commit comments

Comments
 (0)