How to prevent devices from caching data at the network transport layer


  • An application appears to take up more disk space than anticipated.


The network transfer layer caches information for network messages. This information takes up unwanted space. Since iOS10, this overhead has become significant and can impact dramatically on the expected footprint of smaller application installations. 


There is currently no direct way to prevent this from happening. However, you can patch the trampoline as a workaround.

In Classes/Unity/, add the following method override after the @synthesize declarations:

- (NSCachedURLResponse*)connection:(NSURLConnection*)connection willCacheResponse:(NSCachedURLResponse*)cachedResponse 
    return nil;

This should prevent the network transfer layer from caching network messages.


Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.