O'Reilly logo

Objective-C Memory Management Essentials by Gibson Tang, Maxim Vasilkov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Caching

Caching is a concept where you store resources on disk or memory for faster access. Caching will occupy more space, but in situations where you need to worry more about loading speed than memory, caching can be a very good technique to use. Consider this common scenario:

  • Downloading a large file such as an image or even a movie
  • Write the file to a disk
  • Read the files from the disk and display them

If you follow the normal method as mentioned earlier, a bottleneck that you will face is slow loading of the file from disk. Disk access can be as slow as 10,000 or even 1,000,000 slower than memory access and it won't make a good user experience as the user will be kept waiting while your app is loading the files from disk. Caching will help slow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required