kukhariev / ngx-uploadx

Angular Resumable Upload Module
https://github.com/kukhariev/ngx-uploadx
MIT License
43 stars 23 forks source link

uploading the same file should be faster #329

Closed ajeecai closed 2 years ago

ajeecai commented 2 years ago

As far as I know about tus, the client should check if the same file has been uploaded before. if so the upload progress should be fasten and reach 100% in one second.

Here is my observation while running up this demo by "npm start" and uploading the same file several times:

  1. The second uploading is just as a normal uploading, the progress starting from 0% .... to 100% at a normal pace. Check the server side, the file uploaded in last time remains the same size , not truncated to a smaller one. Finally its timestamp is updated.
  2. During the second uploading, I make it offline by using chrome dev tool, the uploading turns into "paused", then I turn it back to "No throttling", the progress go directly to 100%, as sudden as lightning.

Thanks

kukhariev commented 2 years ago

@ajeecai This is controlled by the server:

Other tus servers usually create a new file. Incomplete files are not overwritten, of course.

I'll try to make it more consistent.

ajeecai commented 2 years ago

Thank you @kukhariev, it looks better if we don't overwrite the completed files since that will demo resumable (Just curious, tell if the same file by only filenames or hash value? I don't read all of the code for now),

kukhariev commented 2 years ago

file metadata md5 hash: https://github.com/kukhariev/node-uploadx/blob/1f5935e9be12349ed3a5b3f7f5b03e1961520ffd/packages/core/src/storages/file.ts#L12-L17

ajeecai commented 2 years ago

Thank you, could you also publish this update so that I could get it from npmjs?

Thanks