Looking at GitHub for a long time about the framework of the cache, but also accumulated some foundation, want to try to write a mysterious caching framework.
First, let's analyze how to get started. What is the framework's broad architecture?
The following is given:
So the frame structure comes out:
1. Zsycache provides some APIs for callers to use all methods of caching
2. Zsycachequeue, Zsycachepool as the structure of the cached data
3. Zsycacheholder Persistent Objects
4. Zsycacheobject wrapping the persisted object related additional properties: Save the NSData of the object, the time when the Record object expires
Note: objects are nskeyedarchiver into NSData and then written to local files, so you need to use the Nscoding protocol to introduce a code--autocoding that automatically implements coding.
Implementing the object Cache Framework I. Framework Architecture