Fetch streams are commonly misused for measuring upload/download progress, but they provide inaccurate results because they measure when data is buffered rather than actually transmitted. For downloads, Content-Encoding issues cause decoded chunks to exceed Content-Length values. For uploads, streams measure when fetch takes data from your stream, not when it's successfully sent over the network. XMLHttpRequest remains the best current solution for progress tracking, while a new fetch observer API is being developed to properly address this gap.

6m read timeFrom jakearchibald.com
Post cover image
Table of contents
Response streamsRequest streamsHow to measure upload progressBut in future…

Sort: