aboutsummaryrefslogtreecommitdiffstats
path: root/build.js
diff options
context:
space:
mode:
Diffstat (limited to 'build.js')
-rw-r--r--build.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/build.js b/build.js
index f97907f..6a10eda 100644
--- a/build.js
+++ b/build.js
@@ -86,6 +86,10 @@ self.addEventListener('fetch', (e) => {
// Feed snapshots have their own short HTTP lifetime; never freeze one in Cache Storage.
if (u.pathname === '/api/feed') return;
+ // Streams: a live playlist grows every two seconds (frozen at its first
+ // copy, the player stalled and failed), and video segments would fill the
+ // cache with what's already been watched.
+ if (u.pathname.startsWith('/live/') || u.pathname.startsWith('/vmedia/hls')) return;
if (req.mode === 'navigate') {
// A note page comes back with its thread rendered into it (the server's
@@ -350,7 +354,9 @@ async function bundleApp({ minify, features, staging, splitting = false }) {
// (Mediabunny, ~700 KB) would ride along in a file meant to be small
// and offline — there it uploads the original, as before
...(splitting ? [] : [{ name: 'no-video-compress', setup(build) {
- build.onLoad({ filter: /src\/video-compress\.js$/ }, () => ({ loader: 'js', contents: 'export async function compressVideo(f) { return f; }' }));
+ build.onLoad({ filter: /src\/video-compress\.js$/ }, () => ({ loader: 'js', contents: 'export async function compressVideo(f) { return f; } export async function streamVideo() { return null; } export const STREAM_MIN_S = 90;' }));
+ // likewise hls.js (~400 KB): Firefox's player for live streams
+ build.onLoad({ filter: /src\/hls-player\.js$/ }, () => ({ loader: 'js', contents: 'export async function attachHls() { return null; }' }));
} }])],
});
if (!result.success) {