Am very much disappointed in that restkit has removed the cache policy in their newer version.
How we can achieve the same in newer version? and is it possible can we use existing restkit classes for this Or any other way to implement the same ?
I solved this problem by subclassing RKObjectManager (as outlined in the 2nd point in the link in nik's answer but specified in a little more detail in the docs under "Customization & Subclassing Notes").
I added the following method to the subclass and there was no more caching:
- (NSMutableURLRequest *)requestWithObject:(id)object method:(RKRequestMethod)method path:(NSString *)path parameters:(NSDictionary *)parameters
{
NSMutableURLRequest *request = [super requestWithObject:object method:method path:path parameters:parameters];
request.cachePolicy = NSURLRequestReloadIgnoringLocalAndRemoteCacheData;
return request;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With