Hello,
I'm hosting a web service that downloads images from the user's dropbox using a shared link. Think thousands of users.
To download the images i use this piece of code:
private async Task<byte[]> GetDropboxByteArrayAsync(Metadata item, string sharedLink)
{
DropboxClient client = new DropboxClient(DropBoxKey);
SharedLink sl = new SharedLink(sharedLink, null);
var file = await client.Sharing.GetSharedLinkFileAsync(sl.Url, "/" + item.Name, null);
var fileAsByteArray = await file.GetContentAsByteArrayAsync();
return fileAsByteArray;
}
Once I download the image from dropbox i keep it on a cache so i don't download the same image over and over again.
I'm not sure if i'm approaching this the right way. All the request are using the same OAuth key. That's because the users don't want to log into their dropbox account all the time, that's the point of using the shared link.
The thing is, I'm getting the Rate Limit exception and i don´t know if it is by the number of users requesting images at the same time or the number of threads that I create for a single user.
¿How should I do this?
¿Do I need to generate new OAuths keys?
¿Do I need to keep the DropBoxClient instance and reuse it?
Thank you.