Learn how to make the most out of the Dropbox Community here 💙. 

Forum Discussion

PoulChr's avatar
PoulChr
Helpful | Level 6
7 years ago
Solved

Several xmlhttprequest: very slow

My R-pi based weatherstation collects 48 measurements over an hour. When a new hour starts, these are saved in a file and uploaded to dropbox,  - and a new collection begins. When a new day starts...
  • Greg-DB's avatar
    Greg-DB
    7 years ago

    Thanks! I just tried this, and the network requests to the Dropbox links aren't running particularly slowly for me. How are you measuring this? What step exactly is running slow?

    I do notice that you have `result` scoped outside any particular function, and you're doing `result+= xhr.responseText`, meaning that each call will yield the concatenation of the results of all previous calls, in addition to the current call. Is that what you intended? The size of that may grow relatively large, especially if the csv files are large to begin with, which could slow down execution. You may want to scope the `result` variable to inside your `onreadystatechange` function, and just pass just the current result to `addTxt`, if that makes sense for what you're building.

    Anyway, that aside, I don't see any particular issues with the Dropbox service itself here, but please let me know if I'm missing something.

    Also, one other note, you're writing these links to access 'dl.dropbox.com', but that will result in a redirect anyway. If you want to avoid that, you should use 'dl.dropboxusercontent.com' instead. Be aware that accessing file data programmatically via either of these domains isn't officially supported anyway. (You're supposed to use the 'raw=1' parameter, for instance, as documented here, but that may not work for your use case.)

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers809 PostsLatest Activity: 10 days ago
227 Following

If you need more help you can view your support options (expected response time for an email or 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!