title: How to set the Caching Model (for NSURLCache & UIWebView) in iOS?
body: <p>I'm wondering if this is a bug in the iOS framework.  The NSURLCache setMemoryCapacity: method is being called with 0 and making it stop caching.  </p>
  
  <p>I'm seeing this happen when presenting a UIWebView.  I'm using SDURLCache and overrode setMemoryCapacity: and put a breakpoint there if the memoryCapacity passed in was zero so I could see who was clearing it:</p>
  
  <pre><code>(gdb) bt
  #0  -[SDURLCache setMemoryCapacity:] (self=0x18fc80, _cmd=0x347fee55, memoryCapacity=0) at /Users/me/Documents/Work/Clients/Joe/iphone-TESTapp/SDURLCache/SDURLCache.m:447
  #1  0x33ddac3e in +[WebView(WebFileInternal) _setCacheModel:] ()
  #2  0x33dda388 in +[WebView(WebFileInternal) _preferencesChangedNotification:] ()
  #3  0x30ec27a4 in __invoking___ ()
  #4  0x30e3a43c in -[NSInvocation invoke] ()
  #5  0x36493c3c in SendMessage ()
  #6  0x36493c14 in HandleAPISource ()
  #7  0x30e96a78 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
  #8  0x30e986a2 in __CFRunLoopDoSources0 ()
  #9  0x30e994ea in __CFRunLoopRun ()
  #10 0x30e29ec2 in CFRunLoopRunSpecific ()
  #11 0x30e29dca in CFRunLoopRunInMode ()
  #12 0x36492284 in RunWebThread ()
  #13 0x35ba5310 in _pthread_start ()
  #14 0x35ba6bbc in thread_start ()
  </code></pre>
  
  <p>Some kind of preferences change getting posted?  I see the cacheModel stuff in WebPreferences.h  which is only Mac OS X SDK :-(</p>
  
  <p>So, Ideally we'd have some way to set the Caching policy but I don't know how to do that. I don't understand why it's picking up a cache model such that no caching is occurring.</p>
  
  <p>Anyone know how to set the caching model for an iOS app to something more like WebCacheModelPrimaryWebBrowser?</p>
  
  <p>This is similar to <a href="https://stackoverflow.com/questions/2153268/nsurlcache-memory-size-is-zero">NSURLCache Memory Size is zero</a> but I'm hoping that by providing more details I might get an answer...</p>