Follow

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

Symptoms

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

Cause

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. 

Resolution

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

In Classes/Unity/WWWConnection.mm, 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

0 Comments

Please sign in to leave a comment.