From a6c5e6292386d44d0af2c93c3e33508aaca8c979 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 24 Feb 2019 10:38:00 +0900 Subject: [PATCH] =?UTF-8?q?assets=E3=81=AEjs=E8=A6=81=E6=B1=82=E6=99=82?= =?UTF-8?q?=E3=81=ABsalt=E3=82=92=E4=BB=98=E3=81=91=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=20(#4358)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * No assets salt * remove related code --- src/client/app/boot.js | 10 +--------- src/server/web/index.ts | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/client/app/boot.js b/src/client/app/boot.js index f93cb407e8..9af58076e7 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -108,16 +108,11 @@ app = isMobile ? 'mobile' : 'desktop'; } - // Get salt query - const salt = localStorage.getItem('salt') - ? `?salt=${localStorage.getItem('salt')}` - : ''; - // Load an app script // Note: 'async' make it possible to load the script asyncly. // 'defer' make it possible to run the script when the dom loaded. const script = document.createElement('script'); - script.setAttribute('src', `/assets/${app}.${ver}.js${salt}`); + script.setAttribute('src', `/assets/${app}.${ver}.js`); script.setAttribute('async', 'true'); script.setAttribute('defer', 'true'); head.appendChild(script); @@ -155,9 +150,6 @@ localStorage.removeItem('locale'); - // Random - localStorage.setItem('salt', Math.random().toString().substr(2, 8)); - // Clear cache (service worker) try { navigator.serviceWorker.controller.postMessage('clear'); diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 61878d880b..b51d6659c4 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -55,7 +55,6 @@ router.get('/assets/*', async ctx => { await send(ctx as any, ctx.path, { root: client, maxage: ms('7 days'), - immutable: true }); });