Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello!
I'm now working on the simple Dropbox viewer application.
Currently I'm using "download to Documents folder" method like that:
if let data = NSData(contentsOfFile: destinationPath) {
print("File already cached")
} else {
print("File not cached, processing cache operation...")
Manager.client.loadFile(filePath, intoPath: destinationPath)
}
Files are downloading properly, but, I think, that it's a wrong way to cache files.
So, the question is: is there a way to cache images with standard API tools and, for example, store them with NSCache or something similar?
P.S. It's not essentially important, actually, in which programming language will be answer, I'm simply trying to understand the principles, if they exist
Thanks!
The Dropbox API and SDK themselves don't offer local caching like this, so you will need to implement it in your app's code if your app needs caching. Actual caching strategies and algorithms are beyond the scope of just Dropbox/Dropbox API support, so I can't offer much help with that in general. Perhaps someone here can offer some advice or direct you to some good resources though.
One thing I will note specific to Dropbox though, is to check the rev for the value. The remote Dropbox file could have changed after you originally downloaded it, meaning the copy you have locally is out of date.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!