Skip to content

Instantly share code, notes, and snippets.

@TonnyXu
Created May 24, 2012 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TonnyXu/2780004 to your computer and use it in GitHub Desktop.
Save TonnyXu/2780004 to your computer and use it in GitHub Desktop.
2012-05-24 iOS Sample Code Study Group

NSCache, NSURLCache, NSCachedResponse in Fundation.framework

NSCache

  • Is an in memory cache mechanism
  • Just like NSMutableDictionary
  • Available when iOS > 4.0
  • Can be set with a limit

See Document for more information.

NSURLCache

  • Composited with in memory cache and on disk cache
  • Can be distinguished by URL
  • Use or Not use the cache need to be determined by yourself.

See Document

NSCachedResponse

  • The whole response is cached in memory or on disk
  • easy to retrieve data

See Document

@TonnyXu
Copy link
Author

TonnyXu commented May 24, 2012

the disk cache on iOS is somehow disabled, use SDURLCache to get it back

https://github.com/rs/SDURLCache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment