How can I improve the efficiency of my app’s file handling?

0
4
Asked By TechyNinja24 On

I'm currently trying to figure out whether there's an inefficiency in how my app handles files. Right now, my app retrieves zip files from a server, extracts them, and sends back an array with a single file from each zip to the user. I'm wondering if it would be more efficient to send the entire array of zip files to the client and let the JavaScript on the user's end handle the unzipping instead. Just so you know, these are all small text files.

2 Answers

Answered By CodeWhisperer99 On

If your server is already sending gzipped content, using zip files might not help reduce your data transfer. If the unzipping process is causing a bottleneck on the server, then sending the zips to the client could work better. But keep in mind that you might end up adding some latency on the client side. Just be sure to measure the performance trade-offs to see what really makes sense for your situation.

Answered By DataDynamo56 On

Why are the files zipped in the first place? If you don’t have a database handling your data, maybe consider streaming it over a WebSocket. This way, you'll avoid blocking and can update the client as data comes in, which could make things a lot smoother.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.