DEV Community

Discussion on: The Better Way of Sending Data to the Backend

Collapse
 
momander profile image
Martin Omander

Interesting article. Whenever I read an article saying "do it this way because it's faster" I wish the author would have run performance tests and included the results. If they haven't run tests, how do they know that it's actually faster?

Collapse
 
manas_dev profile image
Manas Mishra

I haven't run the test, but I faced this issue, while developing a scenario, where we have to upload multiple audiobook chapters, and the former way of sending and receiving data is crashing the website, and taking a lot of time (while uploading 500MB of one episode), but with the later version with FormData, its workinh smoothly.

Collapse
 
momander profile image
Martin Omander

Great! What you described is an informal performance test. "Uploading a 500 MB file used to crash the server, but with the new code that doesn't happen any more". Perhaps add a couple of sentences about that to the article?

Thread Thread
 
womingzi profile image
jieshao

Uploading a 500 MB file used to crash the server, but with the new code that doesn't happen any more

If it is more or less, what happens?

LOL Beans

Collapse
 
kingkeith profile image
Keef

Especially as converting base64 to/from binary data is super fast - the slow part comes because base64 representation is a lot bigger, so if uploading/downloading in that format, it will use more bandwidth and thus take longer