I'm using NSUrlSession
to download the contents of an HTML page (so I can parse it, against my will). My problem is that iOS seems to be caching the page with my app, so that even if I update this page on the server, my app keeps seeing the old version (this persists until I delete and reinstall the app).
How can I get NSUrlSession to always download a fresh copy?
Edit: not that complicated, just had to change this:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]
to this:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:0];