1

I have a plist on my server that I provide for an app. On launch the app downloads the plist and checks a few things before continuing with the launch.

The issue I am running into is that when I update the plist on my server, the app seems to download the old version every time. At least from the console log, I am not seeing the updates I did in the plist. I am updating an integer to check and compare with an installed file, but the integer doesn't change to the new one.

I am not sure whether my server (some hosting company) is serving a cached version - when viewing the file in a browser or through FTP, it's fine and is the new updated integer - or whether the issues is with the app? I am using AFNetworking, is there some crazy caching going on?

Any advice is much appreciated.

UPDATE: I just tried to delete the file on the server and re-launch the app and the console still outputs the file... Seems so be some weird caching in the app, no?

runmad
  • 14,846
  • 9
  • 99
  • 140

1 Answers1

1

I haven't used AFNetworking (yet!) but I ran into a similar issue a while back using NSURLRequest and I found that creating the request using requestWithURL:cachePolicy:timeoutInterval: and specifying a cache policy rather than just requestWithURL: solved my problem.

e.g. NSURLRequest *urlRequest = [NSURLRequest requestWithURL:downloadURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60];

I hope this helps.

westsix
  • 26
  • 1
  • Thanks. I removed the AFNetworking code from this networking call, and just use NSURLConnection, which seems to have fixed it. Just surprised, since looking at the classes for AFNetworking doesn't reveal any strict caching. – runmad Jul 01 '12 at 14:39