Restkit, disable caching

It is very difficult for me to try disabling caching in the Restkit infrastructure. I am trying to set the cache policy to none, without any effect. What is the right way to do this?

+5
source share
1 answer

So, if you have a client, or it explicitly initializes it:

RKClient *client = [RKClient clientWithBaseURL:url];

or by allowing the object manager:

RKObjectManager* om = [RKObjectManager managerWithBaseURLString:url];
RKClient *client = om.client;

You just need to set the caching policy:

client.cachePolicy = RKRequestCachePolicyNone;

Was that what you were doing?

Update: Since the registration message is the only thing that bothers me, I decided to track its source. Tl version; dr should ignore the message and trust what the proxy tells you.

, "Invalidating cache at path" RKCache invalidateSubDirectory: RKCache invalidateAll . :

#0  0x000e6c66 in -[RKCache invalidateSubDirectory:] at RestKit/Code/Support/RKCache.m:189
#1  0x0006b767 in -[RKRequestCache invalidateWithStoragePolicy:] at RestKit/Code/Network/RKRequestCache.m:237
#2  0x0006b958 in -[RKRequestCache setStoragePolicy:] at RestKit/Code/Network/RKRequestCache.m:253
#3  0x00069abf in -[RKRequestCache initWithPath:storagePolicy:] at RestKit/Code/Network/RKRequestCache.m:60
#4  0x000586f3 in -[RKClient baseURLDidChange:] at RestKit/Code/Network/RKClient.m:339
#5  0x000589ce in -[RKClient observeValueForKeyPath:ofObject:change:context:] at RestKit/Code/Network/RKClient.m:373
#6  0x0183cd91 in NSKeyValueNotifyObserver ()
#7  0x0183c895 in NSKeyValueDidChange ()
#8  0x0182233e in -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] ()
#9  0x01844a82 in _NSSetObjectValueAndNotify ()
#10 0x00057404 in -[RKClient initWithBaseURL:] at RestKit/Code/Network/RKClient.m:176
#11 0x00056df3 in +[RKClient clientWithBaseURL:] at RestKit/Code/Network/RKClient.m:130

, , , :

  • RKRequestCachePolicy, , , .
  • RKRequestCacheStoragePolicy, , (, , ).

, URL- , RKRequestCacheStoragePolicyPermanently, - - . , .

+7

All Articles