In my iOS app, I am using NSURLSessionTask to download json data to my app. I discovered that when I call the url directly from the browser, I get an up to date
Swift 4 & 5
I know it's been a while, but in case it might help someone in the future.
You may also use .ephemeral configuration property of URLSession, which doesn't save any cookies and caches by default.
As documentation goes,
An ephemeral session configuration object is similar to a default session configuration, except that the corresponding session object doesn’t store caches, credential stores, or any session-related data to disk. Instead, session-related data is stored in RAM.
So, your code might look like this:
let configuration = URLSessionConfiguration.ephemeral
let session = URLSession(configuration: configuration)