This document proposes using WebSockets to load images asynchronously to speed up page loading. It outlines how browsers currently load images synchronously over HTTP, causing long wait times. The author suggests establishing a WebSocket connection, sending all image src requests at once, and retrieving the binary image data asynchronously without waiting for each response. This approach could increase image loading speeds by 20-400% according to benchmarks. Open source ITW client and server code examples are provided to implement this technique.
3. How does browser load a image?
Browser Server
● find <img>
● connect to server
● send the request
● wait for response
● receive the response
● draw received image
4. Next is always waiting until previous
is finished
Server
Image 1
Image 2
12. plan
1. establish WS connection
2. find all image's "src" at page
3. send the pack of requests to server
4. retrieve the images
5. draw them
6. ???
7. profit