-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache download URL #30
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Calling
.loadAttributes()
on files loads the download URL from the API but it's not stored so a second call get's required then.download()
is called. Caching would help in case.download()
is called many times, like to download multiple parts from a file (but not the entire file).The only catch I see on doing that is handling when the download URL expires. From my experience seems it expires automatically when the end of the file is downloaded and, probably, when it's not acessed after some time.
We need to handle expiration (checking the HTTP response codes and then requesting a new download URL if needed) and test how MEGA behaves to avoid an additional request in situations where we know it already expired.
The text was updated successfully, but these errors were encountered: