Skip to content

Disable Cache #51

@hobbs

Description

@hobbs

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions