Hi
My app has a local json data file in the resources directory. It also downloads that same file (possibly with updates) from a server and puts it in the cache directory. . The function that turns this into a lua table first looks for this file in the cache directory. If it can’t find it, it looks in the resources directory and copies that file over the cache directory.
The idea is that it will always use the most up to date file from the server if there’s a connections, but will use the copy from previous session if there’s no connection. I put a copy in the resources directory in case there’s no connection when the app is first run. Presumably thereafter it will always be able to use the copy in the cache directory, whether it’s an old copy or a freshly downloaded one.
I find when I test this in Corona (and just now on my iPad), when I make changes to the data file on the server, I have to restart the game twice to see the changes. It seems to be pretty consistent. I think the program is grabbing the file from cache before the updated file has had a chance to finish downloading, so you don’t see the new data until you start up again.
Not sure how to handle this.
thanks.