- From: Guoye Zhang <guoye_zhang@apple.com>
- Date: Tue, 21 Jul 2026 19:53:23 +0000
- To: Julian Reschke <julian.reschke@gmx.de>
- Cc: "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
- Message-id: <246CCAEB-2BCB-4B15-BAFA-997283DC32D5@apple.com>
> On Jul 21, 2026, at 07:20, Julian Reschke <julian.reschke@gmx.de> wrote: > > Am 21.07.2026 um 02:08 schrieb Guoye Zhang: >>> On Jul 19, 2026, at 05:17, Julian Reschke <julian.reschke@gmx.de> wrote: >>> >>> Am 16.07.2026 um 10:45 schrieb Guoye Zhang: >>>> Hi, >>>> We recently enabled zstd support in Safari and received complaints that downloads from a popular cloud storage website are no longer showing progress and no longer resumable. Turns out that they are doing streaming zstd compression so they don’t know the Content-Length. >>>> Are there interests in standardizing a new header field Content- Unencoded-Length (similar to Unencoded-Digest)? I'm also interested in discussing a new range unit unencoded-bytes for download resumption. >>>> Thanks, >>>> Guoye Zhang >>> >>> How about: >>> >>> HEAD /file.bin HTTP/1.1 >>> Host: example.com >>> Accept-Encoding: identity >>> >>> -> >>> >>> HTTP/1.1 200 OK >>> Content-Length: 5242880 >>> >>> This would be the non-encoded length. >>> >>> Yes, one additional round trip (but HEAD can be done after starting the download), race conditions can be avoided with ETags. > > Actually, the Etag wouldn't help because it's for a different representation. (My fault) > >>> Best regards, Julian >> I experimented with HEAD, and got some interesting results: >> 1. For this particular provider, the GET or HEAD responses do not carry >> ETag or Last-Modified headers. Though the URL looks fairly unique. > > Either an oversight, or the server really does not know. > >> 2. Even if I add Accept-Encoding: zstd to the HEAD request, the HEAD >> response does not use Content-Encoding and always contains a valid >> Content-Length. > > "valid" as in "non-encoded", I assume? FWIW, that Content-Length (for the zstd encoded content) would not be what you need. Yes, unencoded. > >> 3. Sometimes HEAD results in a 404 and I haven’t figured out when >> that’s the case. > > That sounds like a bug. > >> 4. They already put a non-standard X-Original-Content-Length header on >> the response which contains the information we need. > > OTOH, the server seems to have a few serious problems, so I have some doubts that it is well maintained. > > Do we actually know what kind of server this is? The server header is nginx, there are also a Via header from Google and an envoy header. > > I asked ChatGPT to do some research (https://chatgpt.com/share/6a5f7d11-badc-83eb-b575-e10c2cbd2178) and the original use case may have been slightly different (filtering, content rewriting...). > >> Preflight with HEAD is not possible since browser downloads are triggered by a Content-Disposition response header and not known ahead of time. We also don’t know if a Content-Encoding is used until the > > a) Content-Disposition: not always, right? > > b) Why is that a problem? The user agent decides to GET the contents; why can't it do a preflight request? It’s not feasible to preflight all browser GET requests with HEAD. > >> response is received. The only viable solution is a concurrent HEAD > > You mean, you don't want to do the extra HEAD if you don't have to? Ok. > >> which can be expensive in HTTP/1. Automatically performing requests not initiated by the browser is also thorny. I think the easiest solution is > > a) Do we need to optimize for HTTP/1.1? (There, I said it). Re expensive: the user agent would need an additional (short-lived) connection. Is that a problem when only needed for a somewhat long running download? (Otherwise you wouldn't need a progress indicator, right?) I agree that we don’t need to optimize for HTTP/1. However, this is a change that could potentially double the number of connections browsers make to the server which will incur additional costs. > > b) How would that request "not be performed by the browser"??? If it's not the browser, who else would do it? Yeah I need to clarify my statement a bit. The browser calls our library to perform HTTP requests, and there are WHATWG specs on how to do it which they do not want to deviate from. It will require more deliberations if the HTTP library starts doing more requests than what the browser initiated. This topic also came up when discussing how to support resumable uploads in browsers. > >> to use the value in X-Original-Content-Length. > > (you might want to test/measure how many servers are returning this, and whether it always has the information that you expect) > >> Maybe this is a topic we can bring to a working group meeting. > Sure. > > Thought: for a server as the one mentioned above, how likely is it that it would be changed to return a new response field? That I don’t know, but it seems like a trivial change for them. > > Best regards, Julian Guoye
Received on Tuesday, 21 July 2026 19:53:30 UTC