cd /news/ai-infrastructure/bug-if-none-match-is-not-handled-con… · home › topics › ai-infrastructure › article
[ARTICLE · art-179254] src=discuss.huggingface.co ↗ pub= topic=ai-infrastructure verified=true sentiment=↓ negative

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

A tester reported that Hugging Face's Hub file download endpoints handle the If-None-Match header inconsistently, failing to return 304 Not Modified as RFC 9110 Section 13.1.2 requires. On the Spaces and Datasets resolve endpoints, a 780-byte test file returned a weak ETag such as W/"<opaque-tag>"; resending that exact weak validator produced 200 OK, while the same opaque tag without the W/ prefix returned 304, even though If-None-Match mandates weak comparison. On the Storage Buckets endpoint (huggingface.co/buckets/<bucket_id>/resolve/<file-path>), the tester asked Hugging Face to confirm whether conditional GET is supported at all and whether the CDN delivery path honors If-None-Match.

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.

read1 min views7 publishedDec 1, 2026

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?

── more in #ai-infrastructure 4 stories · sorted by recency
── more on @hugging face 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/bug-if-none-match-is…] indexed:0 read:1min 2026-12-01 · —