mprimi / nasefa

Send and receive files using NATS
MIT License
46 stars 2 forks source link

Serving a single file via web, loads the entire bundle (unnecessarily) #1

Open mprimi opened 2 years ago

mprimi commented 2 years ago

When a file is requested via web:

handleBundleFileDownload > loadBundleFile > _loadBundle

The latter does a bucket .List() and then _loadFile() on each element. Finally, the list of files is traversed looking for a filename match.

This is unnecessary. _loadBundle could skip loading files, and we could lookup just the one element that is wanted, by filename.