Files
SpotiFLAC-Mobile/rust_backend/crates
zarzet 4d53d7f75c perf(network): revalidate stale Subsonic covers with their ETag
The daily cover check downloaded every stale Subsonic cover in full
and compared it with the cached file byte by byte, although the Link
desktop (and many servers) send an ETag and answer If-None-Match with
304. The first rescan of a day fetched all 500 album covers of a Link
library at original size.

The ETag of a downloaded cover is now kept beside it in
<cover>.etag together with the image length. A stale check sends
If-None-Match; a 304 keeps the path and touches the modification
time, like an unchanged download did, without reading a body. A 200
follows the existing rules (same bytes keep the path, changed bytes
get a new path behind .current) and stores the new ETag. A forced
refresh, a validator for other bytes, older caches and servers
without ETags behave as before.

The validator survives restarts. The Library cover prune (Dart and
Rust) keeps it with a referenced Subsonic cover, as it keeps the
.current pointer, and the song metadata cover cache still keeps 32
covers, each with its ETag, instead of counting ETags as covers.
Older builds ignore the files and their prune removes them.
2026-10-31 22:07:30 +07:00
..