Problem with network.downloa

Hi Folks

network.download("http://xxxxxxx.com/support/news.txt","GET",networkListener,{},"news.txt",system.TemporaryDirectory )

will download the file to the temp directory, but if I update the file on the web and like to download the new version, network.download loads always the old version from a cache.

I try to delete first the old file in the temp directory but this will not help, I get always the old file. If I download a new file e.g. new2.txt then it downloads the new file  but also only once, after this it tokes the file from a cache again.

is this a bug or a feature ?

Mike

Are you by any chance testing this on macOS 10.12? 

Rob

Im working on macOS Sierra 10.12.1…

10.12 seems to have some extra caching layer that isn’t easy to bypass. You shouldn’t have an issue on device. However you can use the old school technique for busting the cache by making the URL unique each time:

local URL = "http://xxxxxxx.com/support/news.txt?cb=" .. math.random(100000) network.download(URL,"GET",networkListener,{},"news.txt",system.TemporaryDirectory )

Rob

Thats works, perfect! thanks a lot Rob.

BR Michael

Are you by any chance testing this on macOS 10.12? 

Rob

Im working on macOS Sierra 10.12.1…

10.12 seems to have some extra caching layer that isn’t easy to bypass. You shouldn’t have an issue on device. However you can use the old school technique for busting the cache by making the URL unique each time:

local URL = "http://xxxxxxx.com/support/news.txt?cb=" .. math.random(100000) network.download(URL,"GET",networkListener,{},"news.txt",system.TemporaryDirectory )

Rob

Thats works, perfect! thanks a lot Rob.

BR Michael