Every tap on a gateway attachment re-downloaded the whole file: the cache write used a random UUID prefix, so no two fetches ever produced the same filename and old copies were never looked up. Cache files are now named deterministically from the gateway path (UUID3 hash + filename), so repeat opens within the TTL (10 min) reuse the existing download and skip the network entirely. Stale entries fall through to a fresh fetch that overwrites the cache via temp-file + rename, so a failed re-download never destroys a previously-good copy. Content types are remembered in-memory per path so cache hits still hand the viewer the right MIME. Also adds isFreshCacheFile()/cacheFileNameFor() unit tests. Co-authored-by: M57 <hy4ri@users.noreply.github.com>