diff --git a/package.json b/package.json index 745a9a23..c43af4a3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.30.0-beta5", + "version": "1.30.0-beta6", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/fonts/fa-solid.css b/resources/fonts/fa-solid.css index a372185a..ff9ec65e 100644 --- a/resources/fonts/fa-solid.css +++ b/resources/fonts/fa-solid.css @@ -11,7 +11,7 @@ font-style: normal; font-weight: 900; font-display: block; - src: url("./fa-solid-900.woff2?__OSC_ASSET__=1") format("woff2"); } + src: url("./fa-solid-900.woff2") format("woff2"); } .fa, .fas, diff --git a/resources/fonts/roboto.css b/resources/fonts/roboto.css index 6d9ce780..52ba4da3 100644 --- a/resources/fonts/roboto.css +++ b/resources/fonts/roboto.css @@ -2,14 +2,14 @@ font-family: 'Roboto'; font-style: normal; font-weight: 700; - src: url('./Roboto-Bold.woff2?__OSC_ASSET__=1') format('woff2'); + src: url('./Roboto-Bold.woff2') format('woff2'); } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; - src: url('./Roboto-Medium.woff2?__OSC_ASSET__=1') format('woff2'); + src: url('./Roboto-Medium.woff2') format('woff2'); } @@ -17,19 +17,19 @@ font-family: 'Roboto'; font-style: normal; font-weight: 400; - src: url('./Roboto-Regular.woff2?__OSC_ASSET__=1') format('woff2'); + src: url('./Roboto-Regular.woff2') format('woff2'); } @font-face { font-family: 'Roboto'; font-style: normal; font-weight: 100; - src: url('./Roboto-Light.woff2?__OSC_ASSET__=1') format('woff2'); + src: url('./Roboto-Light.woff2') format('woff2'); } @font-face { font-family: 'Roboto Mono'; font-style: normal; font-weight: 500; - src: url('./roboto-mono.woff?__OSC_ASSET__=1') format('woff'); + src: url('./roboto-mono.woff') format('woff'); } diff --git a/scripts/client.rollup.config.js b/scripts/client.rollup.config.js index 05f94f8d..2a708795 100644 --- a/scripts/client.rollup.config.js +++ b/scripts/client.rollup.config.js @@ -15,8 +15,8 @@ module.exports = { output: [ { dir: 'app/client/', - chunkFileNames: `[name]-${package.version}.js`, - entryFileNames: `[name]-${package.version}.js`, + chunkFileNames: `[name].js`, + entryFileNames: `[name].js`, format: 'es', sourcemap: true, sourcemapExcludeSources: true diff --git a/scripts/launcher.rollup.config.js b/scripts/launcher.rollup.config.js index 6c6ccfb4..c0b2eda1 100644 --- a/scripts/launcher.rollup.config.js +++ b/scripts/launcher.rollup.config.js @@ -13,7 +13,7 @@ module.exports = { output: [ { dir: 'app/launcher/', - chunkFileNames: `[name]-${package.version}.js`, + chunkFileNames: `[name].js`, format: 'commonjs', sourcemap: true, sourcemapExcludeSources: true, diff --git a/scripts/server.rollup.config.js b/scripts/server.rollup.config.js index 8fcabe0a..dac5b03a 100644 --- a/scripts/server.rollup.config.js +++ b/scripts/server.rollup.config.js @@ -16,7 +16,7 @@ module.exports = { output: [ { dir: 'app/server/', - chunkFileNames: `[name]-${package.version}.js`, + chunkFileNames: `[name].js`, format: 'commonjs', sourcemap: true, sourcemapExcludeSources: true, diff --git a/src/html/client.html b/src/html/client.html index bcc620c4..24ae5908 100644 --- a/src/html/client.html +++ b/src/html/client.html @@ -7,15 +7,15 @@ - - - - - - - - - + + + + + + + + +
diff --git a/src/server/node/server.mjs b/src/server/node/server.mjs index c631c84c..c87e248c 100644 --- a/src/server/node/server.mjs +++ b/src/server/node/server.mjs @@ -127,7 +127,21 @@ class WebServer extends EventEmitter { res.sendFile = (path)=>{ var fpath = path.split('?')[0] - if (!fs.existsSync(fpath)) throw `File "${fpath}" not found.` + var stats = fs.statSync(fpath) + if (!stats || !stats.isFile()) { + throw `File "${fpath}" not found.` + } + var lastModified = new Date(stats.mtime) + lastModified.setMilliseconds(0) + res.setHeader('Cache-Control', 'no-cache') + res.setHeader("Last-Modified", lastModified.toUTCString()) + if ( + req.headers['if-modified-since'] && new Date(req.headers['if-modified-since']).getTime() >= lastModified.getTime() + ) { + res.statusCode = 304 + res.end() + return + } return send(req, fpath).pipe(res) } @@ -152,6 +166,7 @@ class WebServer extends EventEmitter { clientOptions[k] = v } } + res.setHeader('Cache-Control', 'no-store') fs.createReadStream(path.resolve(__dirname + '/../../client/index.html')) .pipe(replaceStream('', `