Academy films: locally generated physics videos of the roast and the brew
Test and deploy / test-and-deploy (push) Successful in 1m1s
Test and deploy / test-and-deploy (push) Successful in 1m1s
Two short macro films generated on the local ComfyUI instance (Wan 2.2 14B t2v + lightx2v 4-step LoRAs, 9 clips at 832x480) and stitched with crossfades and burned-in phase labels: roast-physics.mp4 (charge, drying, Maillard, first crack, drop) and brew-physics.mp4 (grind, bloom, immersion, espresso). A "Films — the physics in motion" card on the Academy menu plays them with posters; opening a lesson hides and pauses them. The service worker now bypasses /academy-video/ and /academy-audio/ (Range/206 responses the Cache API rejects) and only caches full 200s. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
+9
-3
@@ -64,7 +64,11 @@ self.addEventListener("fetch", (event) => {
|
||||
if (
|
||||
request.method !== "GET" ||
|
||||
url.origin !== self.location.origin ||
|
||||
url.pathname.startsWith("/api/")
|
||||
url.pathname.startsWith("/api/") ||
|
||||
// Media streams use Range requests (206 responses the Cache API rejects) and are far
|
||||
// too large to belong in the static cache — let the browser handle them natively.
|
||||
url.pathname.startsWith("/academy-video/") ||
|
||||
url.pathname.startsWith("/academy-audio/")
|
||||
)
|
||||
return;
|
||||
|
||||
@@ -86,10 +90,12 @@ self.addEventListener("fetch", (event) => {
|
||||
event.respondWith(
|
||||
fetch(request)
|
||||
.then((response) => {
|
||||
if (response.ok)
|
||||
// Only full 200 responses: cache.put() throws on 206 partials.
|
||||
if (response.status === 200)
|
||||
caches
|
||||
.open(CACHE_NAME)
|
||||
.then((cache) => cache.put(request, response.clone()));
|
||||
.then((cache) => cache.put(request, response.clone()))
|
||||
.catch(() => {});
|
||||
return response;
|
||||
})
|
||||
.catch(() => caches.match(request)),
|
||||
|
||||
Reference in New Issue
Block a user