I tested conditional GET requests for files served by Hugging Face Spaces, Datasets, and Storage Buckets. Matching If-None-Match validators do not consistently produce 304 Not Modified.
I uploaded the same 780-byte test file to test repositories. For each endpoint, I first issued a GET, captured the returned ETag, and then repeated the GET with that exact value in If-None-Match.
Spaces endpoint:
https://huggingface.co/spaces/<repo_id>/resolve/main/<file-path>
Datasets endpoint:
https://huggingface.co/datasets/<repo_id>/resolve/main/<file-path>
Observed behavior on both endpoints:
200 OK and a weak ETag, for example W/"<opaque-tag>". If-None-Match: W/"<opaque-tag>" returns If-None-Match: "<opaque-tag>" (same opaque tag, but without the W/ prefix) returns 304 Not Modified with an empty body.
The exact weak ETag returned by the server should match under the weak comparison required for If-None-Match.
Endpoint:
https://huggingface.co/buckets/<bucket_id>/resolve/<file-path>
Observed behavior:
If-None-Match set to the returned ETag still returns 304.
Could you confirm whether conditional GET is supported for Bucket downloads? If it is supported, please investigate whether the CDN delivery path is honoring If-None-Match.
For GET requests, when If-None-Match matches the current representation’s ETag, the response should be:
RFC 9110, Section 13.1.2 specifies weak comparison for If-None-Match:
RFC 9110, Section 13.1.2
fetch
Could you confirm whether these are known limitations or bugs in the Hub resolve endpoints and the Bucket CDN delivery path?