mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-14 05:17:13 +02:00
Transcoded stream responses only carried Last-Modified (the source file's mtime, which is identical across every bitrate/format/offset), so a client had no cheap way to confirm it already holds a specific transcoded representation and re-downloaded the full audio on every repeat request within a single playback. Advertise a weak, representation-specific ETag derived from the transcode cache key (id, mtime, bitrate, format, sampleRate, bitDepth, channels, offset). On the fully-cached seekable path http.ServeContent now answers a matching If-None-Match with 304 Not Modified instead of re-sending the audio, cutting redundant transfer for repeated in-playback requests. The tag is weak because ffmpeg output is not guaranteed byte-identical across runs; it stays valid for If-None-Match revalidation while http.ServeContent correctly declines to use it for If-Range sub-range assembly. Fixes #5720 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: TowyTowy <towy@airreps.link> |
||
|---|---|---|
| .. | ||
| aliases.go | ||
| aliases_test.go | ||
| codec.go | ||
| codec_test.go | ||
| decider.go | ||
| decider_test.go | ||
| legacy_client.go | ||
| legacy_client_test.go | ||
| limitations.go | ||
| limiter.go | ||
| limiter_test.go | ||
| media_streamer.go | ||
| media_streamer_test.go | ||
| stream_suite_test.go | ||
| token.go | ||
| token_test.go | ||
| types.go | ||
| types_test.go | ||