FourthWorld wrote: ↑Fri Feb 14, 2020 4:04 pm
...the "load url" command is non-blocking, with a callback message to notify you when the download is complete ...
Yes, I noticed that ....
1. I guess one should never use "put URL .... into tTemp" with internet documents because the remote server may hang or be extremely slow, and we wouldn't know. So, use "load URL ... " every time.
2. "Load .... " doesn't work when the access needs to be authenticated (as with AWS), and the content is accessed with LC AWS library commands such as AWSGetObject. I assume these are non-blocking, too?
3. This is my (tentative) procedure:
a. Check periodically a public file that contains a single number -- the update date. If it is later than what is on the device, initiate update.
b. Check authentication and connection by downloading a tiny private file.
c. Download the bucket contents -- name, date modified, size
d. Compare it with the local storage -- make a list of files that are new or modified, i.e., to be downloaded.
e. Download the files.
f. Update local metadata
Step (e) above is likely to be relatively time-consuming; if there are 10-15 pdf files to be downloaded (each 250K size, say), it may take several seconds to minutes, depending on the quality of the internet connection and the point of access in the world. I need to come up with a strategy. Since this problem is faced by every app that refreshes content regularly, I figured there must be a well-tested, generally accepted strategy available.
Regards,
Sri