fine-uploader icon indicating copy to clipboard operation
fine-uploader copied to clipboard

getSas - PUT block context => decrease server calls to optimize upload flow

Open coronag opened this issue 6 years ago • 0 comments

Type of issue

  • [ ] Bug report
  • [x] Feature request

Uploader type

  • [ ] Traditional
  • [ ] S3
  • [x] Azure
GetSasKey => cache storage to avoid asking for a new sas key if the last one is still valid for a long time [...]

If a sas key has a lifetime of 5 minutes and the last request was made 2 seconds before... it is not required to request a new one. It is more important with concurrent calls (many calls for a same sas key).

We use 4MB chunks and concurrent is enabled. 4Mb is a good compromise for bad connections and concurrent helps good connections. Before each PUT request, a call is made to get a fresh SaS key. Our SasKey duration is 5 minutes. Client may avoid requesting the server for a fresh SasKey during for instance 1 minute. Why : this avoid for a very good connection to got many getSasKey request while the SasKey is still valid. Why not much more than 1 minute : for bad connections to avoid having an invalid saskey for a given block blob.

Possible evolutions:

  • an option to specify a sasKeyStorage : if not set, still as actually and if one is given then fineupload will try to use it first before sending a request
  • not as good as the first one, because not good with all browsers : an option to avoid adding "timestamp" (withcacheburst method) so that the server can set an http cache respone to 1 minute for instance (browser cache).

coronag avatar Sep 28 '18 14:09 coronag