0

How do we disable caching policy in xamarin ios. I have referred to the following links .

https://github.com/nowsecure/secure-mobile-development/blob/master/en/ios/avoid-caching-https-requests-responses.md

NSURLConnection Delegate Returns Null

Please let me know the equivalent code in c # (Xamarin.iOS)

Can we add something in info.plist?

Scath
  • 3,777
  • 10
  • 29
  • 40

1 Answers1

1

From iOS 7+ we begin to use NSUrlSession to handle web task instead of NSUrlConnection. Then you can try below code to disable the cache:

NSUrlSessionConfiguration configure = NSUrlSessionConfiguration.DefaultSessionConfiguration;
configure.RequestCachePolicy = NSUrlRequestCachePolicy.ReloadIgnoringLocalCacheData;
configure.URLCache = null;

NSUrlSession session = NSUrlSession.FromConfiguration(configure);
Ax1le
  • 6,563
  • 2
  • 14
  • 61