Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Cache #51

Open
hobbs opened this issue Sep 28, 2014 · 0 comments
Open

Disable Cache #51

hobbs opened this issue Sep 28, 2014 · 0 comments

Comments

@hobbs
Copy link

hobbs commented Sep 28, 2014

I'm pretty new to AFNetworking and iOS development in general, but I'm having a hard time figuring out how to disable all caching when I make certain calls.

I have tried changing the cache policy in RKClient.m:

- (id)init
{
    if (self = [super initWithBaseURL:[[self class] APIBaseURL]])
    {
        self.session.configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;

I've also tried disabling the NSURLCache entirely by adding this to my AppDelegate:

NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0
                                              diskCapacity:0
                                              diskPath:nil];
[NSURLCache setSharedURLCache:sharedCache];

Neither appears to be working for me when I am calling RKClient.commentsForLinkWithIdentifier when I compare the results to just hitting the API in a browser. This question probably isn't RedditKit specific, but thought you might be able to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant