Http headers and cache for model files
I am trying to use HF repo model files in a web app (html+js).When requesting files viafetch()it never uses browser cache and always download. This might not be an issue for small files, but for large it takes unnecessary traffic and a lot of time to download.JS has APIs to enforce custom cache strategies, however, I think reliable default browser cache should be in place esp for something as straightforward as downloading a file.I have tried multiple ways to construct the url includingdownloadFile, branch, revision url etc.:await fetch('https://huggingface.co/wide-video/piper-voices-v1.0.1/resolve/main/README.md');
await fetch('https://huggingface.co/wide-video/piper-voices-v1.0.1/raw/main/README.md');
await fetch('https://huggingface.co/wide-video/piper-voices-v1.0.1/resolve/ed0d5c4294d9ca9d93cedef7d3f684d44b370784/README.md');
await fetch('https://huggingface.co/wide-video/piper-voices-v1.0.1/raw/ed0d5c4294d9ca9d93cedef7d3f684d44b370784/README.md');
await fetch('https://huggingface.co/wide-video/piper-voices-v1.0.1/resolve/main/README.md?download=true');
await fetch('https://huggingface.co/wide-video/piper-voices-v1.0.1/raw/main/README.md?download=true');Following request headers are being sent::authority: huggingface.co
:method: GET
:path: /wide-video/piper-voices-v1.0.1/resolve/ed0d5c4294d9ca9d93cedef7d3f684d44b370784/README.md
:scheme: https
Accept: */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9,cs;q=0.8,sk;q=0.7,de;q=0.6,ja;q=0.5,fr;q=0.4
If-None-Match: "59dba63f5d7a311e4d8cc3f12d513bc3945c6378"
Origin: https://localhost
Referer: https://localhost/
Sec-Ch-Ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "macOS"
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36And response:Accept-Ranges: bytes
Access-Control-Allow-Origin: https://localhost
Access-Control-Expose-Headers: X-Repo-Commit,X-Request-Id,X-Error-Code,X-Error-Message,ETag,Link,Accept-Ranges,Content-Range
Content-Disposition: inline; filename*=UTF-8''README.md; filename="README.md";
Content-Length: 311
Content-Security-Policy: default-src none; sandbox
Content-Type: text/plain; charset=utf-8
Cross-Origin-Opener-Policy: same-origin
Date: Thu, 04 Apr 2024 06:52:15 GMT
Etag: "59dba63f5d7a311e4d8cc3f12d513bc3945c6378"
Referrer-Policy: strict-origin-when-cross-origin
Vary: Origin
Via: 1.1 d33f640b9793fb0553cc6dbe55988068.cloudfront.net (CloudFront)
X-Amz-Cf-Id: CXTYjmhLL1BlQVugY3UEW2ldqtNaXSU5Qc0BaJJnS_-890FPvCfR1Q==
X-Amz-Cf-Pop: PRG50-C1
X-Cache: Miss from cloudfront
X-Powered-By: huggingface-moon
X-Repo-Commit: ed0d5c4294d9ca9d93cedef7d3f684d44b370784
X-Request-Id: Root=1-660e4e1f-796f8adc7cce42c432130ddbThe problem is even worse with LFS files, where unique redirect link is generated which introduce some more caching obstacles.Are there some other request arguments / paths to be used or there is no browser cache support in place at all?