Writing fixed sized responses in chunks from worker without "Content-Encoding: Chunks" header


We are concatenating the responses from multiple requests to a single media file using the TransformStream which works, but as the workers respond with the “Content-Encoding: chunks” header the client doesn’t know how long the resulting file will be and can’t show the duration. Some clients, like chrome, uses range requests and then it works just fine, but firefox and safari fetches the file without ranges and handles the result as a live stream.

As we know how long the concatenated file will be it would be great if we could set this header before starting to write the chunks and not use chunks as content-encoding. Would that be possible or is there some other work around we haven’t considered?