# [Bug] If-None-Match is not handled consistently by Hub file download endpoints

> Source: <https://discuss.huggingface.co/t/bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints/192921#post_1>
> Published: 2026-12-01 09:43:11+00:00

**Key takeaway:** Hugging Face's Spaces and Datasets resolve endpoints return 304 only when If-None-Match carries the opaque ETag without the W/ prefix, so clients caching the exact weak validator get a full 200 response instead.

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](https://www.rfc-editor.org/rfc/rfc9110.html#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?
