Reduce number of preflight requests for Azure Storage Services Rest API

205 Views Asked by At

I am uploading my files in Azure Blob Storage using Azure Blob Rest API. I break my file in multiple chunks and upload all chunks 1 by 1 using Put Block rest API. At times if a file is over 1 GB, I have to make more than 100 API calls to completely upload a file.

I have noticed that before every API call, a preflight request is sent by the browser. I have set "Access-Control-Max-Age" header to 3600, but chrome continue to ignore it.

After some research, I found out that browsers don't cache response for put requests, and Put Block rest API is actually a PUT request, that is why a preflight request is made before every call.

Is there a work around for this problem? Sending a preflight request before every call is too expensive and has a hit on performance.

0

There are 0 best solutions below