snapCloud icon indicating copy to clipboard operation
snapCloud copied to clipboard

Store & Serve png files, not base64 data.

Open cycomachead opened this issue 6 years ago • 0 comments

Instead of sending down base64 data, I think we should try to send URLs down instead of data URLs. Primarily, base64 data is about 1.3x the size of the binary format, and it would avoid repeated encoding (on the server) and decoding on the client.

you'd still get asynchronous loading of thumbnails in the Open dialog in Snap!. I guess the Canvas version is where an actual image file might need to be re-encoded, but I still think this would be faster since you'd be transferring less data.

The main difference would be in the request sent down for a page with a lot of project thumbnails. Instead of 1 giant request, the page would load 1 JSON result, then N small requests directly for each thumbnail file. Given that modern browsers (and nginx) handle http/2 well, I think this should make the index pages load quite a bit more quickly.

This isn't necessary for a demo or anything, but I think it'd help performance (both on the server and in the front end).

cycomachead avatar Oct 26 '17 10:10 cycomachead