A cache that never answers 304 wastes bandwidth on every revisit.
etag=$(curl -sI https://example.com/app.js | awk -F': ' 'tolower($1)=="etag" {print $2}' | tr -d '\r')
curl -sI -H "If-None-Match: $etag" https://example.com/app.js | head -1
The first line saves the ETag of the file, the second repeats the request the way a browser does when its copy is stale. HTTP/2 304 means the validator works and no body was sent. A 200 means the server ignores the header, which often happens when two backends generate different ETags for the same file. Keep the quotes that are part of the ETag value, and for a weak ETag the W/ prefix as well. If-Modified-Since works the same way for Last-Modified.
Further reading: MDN: HTTP conditional requests
Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it