Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move serviceworker to workbox and fix SSE interference #11538

Merged
merged 13 commits into from
May 22, 2020
Prev Previous commit
rename item to fit cache name
  • Loading branch information
silverwind committed May 22, 2020
commit 518f6e9075f24ee621c177a0da5995df6e90b283
4 changes: 2 additions & 2 deletions web_src/js/features/serviceworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ async function invalidateCache() {

async function checkCacheValidity() {
const cacheKey = AppVer;
const storedCacheKey = localStorage.getItem('serviceWorkerCacheKey');
const storedCacheKey = localStorage.getItem('staticCacheKey');

// invalidate cache if it belongs to a different gitea version
if (cacheKey && storedCacheKey !== cacheKey) {
invalidateCache();
localStorage.setItem('serviceWorkerCacheKey', cacheKey);
localStorage.setItem('staticCacheKey', cacheKey);
}
}

Expand Down