如何在 RESTkit 0.2 中设置缓存策略
问题描述:
我不清楚如何使用 RESTKit 0.2 API 来设置缓存策略.我每次打开应用程序时都会重新运行一个请求,但我希望它被缓存.如何设置缓存策略以始终缓存请求?
I'm unclear how to use the RESTKit 0.2 API to set the caching policy. I have a request that is being rerun every time I open the app, but I would like it to be cached. How do I set the caching policy to always cache the request?
更新我了解到 RestKit 会自动缓存 Core Data 支持的映射.
Update I learned that RestKit will automatically cache Core Data backed Mappings.
答
缓存由 RKObjectRequestOperation 类.检查文档的缓存"部分.
Caching is controlled by the RKObjectRequestOperation class. Check the 'Caching' section of the documentation.