fix: instant video thumbnails on tab switch + throttle decodes
Backend: - 204 response: add Cache-Control: no-store so browser never caches 'no thumbnail yet' — next GET after PUT upload gets the WebP Frontend: - _videoThumbCache (Map): persists fileId → URL across re-renders, so switching tabs reuses cached URLs instantly (no re-decode) - Render: videos with cached URL skip the 204/error/decode cycle - After PUT succeeds: swap blob URL → server ?v=1 URL so blob is GC'd - Concurrency throttle: max 3 simultaneous video decodes to avoid overwhelming network + CPU when gallery has many videos - Decode queue: pending videos processed as slots free up
This commit is contained in:
@@ -349,7 +349,12 @@ impl FileHandler {
|
||||
.unwrap()
|
||||
.into_response();
|
||||
}
|
||||
return StatusCode::NO_CONTENT.into_response();
|
||||
return Response::builder()
|
||||
.status(StatusCode::NO_CONTENT)
|
||||
.header(header::CACHE_CONTROL, "no-store")
|
||||
.body(Body::empty())
|
||||
.unwrap()
|
||||
.into_response();
|
||||
}
|
||||
|
||||
// Resolve the physical blob path (content-addressable storage)
|
||||
|
||||
Reference in New Issue
Block a user