Skip to content

Commit a7a519d

Browse files
committed
dont cache stuff with cachebust
1 parent 91064eb commit a7a519d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

static/game_worker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ self.addEventListener('activate', event => {
9595
// Helper function to determine if a request should be cached
9696
function isCacheableRequest(request) {
9797
const url = new URL(request.url);
98-
98+
const params = new URLSearchParams(url.search);
99+
if (params.has('cache') && params.get('cache') === 'false' || params.has('cacheBust') || params.has('cachebust') || params.has('bust')) {
100+
return false; // Cache-busting query parameter
101+
}
99102
// Never cache txt files, change often
100103
if (url.pathname.endsWith('.txt')) {
101104
return false;

0 commit comments

Comments
 (0)