Book Image

RestKit for iOS

By : Taras Kalapun
Book Image

RestKit for iOS

By: Taras Kalapun

Overview of this book

<p>RestKit is an iOS framework for streamlining communication with web services, and it relies on the AFNetworking library that is used by thousands of app developers. It has an interface that is elegant and well designed, and it provides a powerful object-mapping engine that integrates well with the CoreData database. RestKit for iOS will teach you everything from loading a simple list of objects to creating a fully-featured app.<br /><br />RestKit for iOS delivers constructive tools and insights into app development that will benefit any app developer. The book starts with a simple example and then moves on to more complex ones as your knowledge increases. By the end of the guide, you will be able to build a fully-featured app that uses RESTful web services and performs CRUD object manipulation.<br /><br />RestKit for iOS will provide you with all the information you need to boost the development process of both simple and complex apps. Once you have executed a simple example and reviewed the basic theory, you will move on to more advanced concepts with descriptions of real-life scenarios and how to overcome bottlenecks. RestKit for iOS is full of real-life examples that show you how to simplify data loading, basic and advanced object mapping, metadata mapping, and routing. This book also teaches you about routing, RESTful object manipulation and synchronization, integration with the user interface, and caching</p>
Table of Contents (13 chapters)

HTTP caching


There are three mechanisms to control a cache defined in HTTP standard, which are as follows:

  • Freshness: This mechanism will allow the user to use a response without rechecking it on the original server. It can be controlled by both the server and the client. For example, the Expires response header will give a date when the document becomes stale, and Cache-Control (the max-age directive) will inform the cache how many seconds the response is fresh (valid) for.

  • Validation: This mechanism may be used for checking whether a cached response is still good after it becomes stale. For example, if a Last-Modified header is in response, a cache can make a next request using the If-Modified-Since header and check if it has changed. The ETag (entity tag) mechanism also allows for both strong and weak validation.

  • Invalidation: This mechanism mostly is a side effect when another request passes through the cache. So, if a URL related with a cached response later on gets a POST, PUT, or...