NSURLCache and Data Protection

I am trying to protect sensitive data stored in NSURLCache. My app's files and Core Data sqlite files are set to NSFileProtectionComplete. However, I am unable to change the NSURLCache files data protection level to anything other than NSFileProtectionCompleteUntilFirstUserAuthentication. This leaves any sensitive data in the cache exposed when the device is locked.

I need to have the responses cached so repeated requests return 304 responses to prevent data from being re-processed multiple times when not necessary to do so. Also, I need the cache to be protected at rest when the device is locked.

Does anyone have any suggestions for protecting NSURLCache data?


The default NSURLCache does not support changing the protection level of its store. I've solved my issue by creating a custom NSURLCache subclass that stores URL responses in a custom SQLite database with file protection set to NSFileProtectionComplete . This seems to be the only solution next to disabling URL caching.

链接地址: http://www.djcxy.com/p/24300.html

上一篇: Resharper 9中的nuget支持哪里去了?

下一篇: NSURLCache和数据保护