I was searching for a simple cache to use for temporary storage of data from web-service calls when I came across EGOCache. Essentially I wanted something that provided the following features:
- Simple key/value storage structure.
- Time expiration of data.
- Persistence of data in the cache.
- Ability to easily store and persist custom objects.
So far EGOCache has worked really well for my purposes, and storing a custom object is as easy as implementing the NSCoding protocol on your object. The cache also provides an easy access mechanism to the global cache through the following call:
Although I recommend using the cache through a wrapper class; it will prevent coupling your code to the implementation and will safeguard your application code from changes to a different caching mechanism.