Skip to content
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

Closed
qgustavor opened this issue Nov 10, 2017 · 1 comment
Closed

Cache download URL #30

qgustavor opened this issue Nov 10, 2017 · 1 comment
Assignees

Comments

@qgustavor
Copy link
Owner

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.

@qgustavor
Copy link
Owner Author

Closing in favor of this: #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant