{"slug": "bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints", "title": "[Bug] If-None-Match is not handled consistently by Hub file download endpoints", "summary": "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.", "body_md": "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`.\n\nI 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`.\n\nSpaces endpoint:\n\n`https://huggingface.co/spaces/<repo_id>/resolve/main/<file-path>`\n\nDatasets endpoint:\n\n`https://huggingface.co/datasets/<repo_id>/resolve/main/<file-path>`\n\nObserved behavior on both endpoints:\n\n`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.\nThe exact weak ETag returned by the server should match under the weak comparison required for `If-None-Match`.\n\nEndpoint:\n\n`https://huggingface.co/buckets/<bucket_id>/resolve/<file-path>`\n\nObserved behavior:\n\n`If-None-Match` set to the returned ETag still returns `304`.\nCould 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`.\n\nFor GET requests, when `If-None-Match` matches the current representation’s ETag, the response should be:\n\nRFC 9110, Section 13.1.2 specifies weak comparison for `If-None-Match`:\n\n[RFC 9110, Section 13.1.2](https://www.rfc-editor.org/rfc/rfc9110.html#section-13.1.2)\n\n`fetch`\nCould you confirm whether these are known limitations or bugs in the Hub resolve endpoints and the Bucket CDN delivery path?", "url": "https://wpnews.pro/news/bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints", "canonical_source": "https://discuss.huggingface.co/t/bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints/192921#post_1", "published_at": "2026-12-01 09:43:11+00:00", "updated_at": "2026-12-01 09:44:58.183719+00:00", "lang": "en", "topics": ["ai-infrastructure", "developer-tools"], "entities": ["Hugging Face", "Hugging Face Spaces", "Hugging Face Datasets", "Hugging Face Storage Buckets", "RFC 9110"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints", "markdown": "https://wpnews.pro/news/bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints.md", "text": "https://wpnews.pro/news/bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints.txt", "jsonld": "https://wpnews.pro/news/bug-if-none-match-is-not-handled-consistently-by-hub-file-download-endpoints.jsonld"}}