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

NSMutableRequest cache policy seems overly restrictive. #73

Closed
normanhh3 opened this issue Apr 4, 2013 · 2 comments
Closed

NSMutableRequest cache policy seems overly restrictive. #73

normanhh3 opened this issue Apr 4, 2013 · 2 comments

Comments

@normanhh3
Copy link

I've got an application where I'd like to have the ability to view the RSS feed content offline but as I look into how the feed URL is pulled in, basically all caching capabilities specified by the client are wiped out.

The following definition ought not to be the default, in my opinion but should be left at the default cache policy NSURLRequestUseProtocolCachePolicy from here.

Option 1
Utilize an additional init parameter to send in the NSURLRequestCachePolicy value.

Option 2
Or possibly the NSURLRequest ought to just come in on the init method so that more of the request can be modified and the init would accept an NSMutableRequest instead of just an NSRequest.

Current Code in MWFeedParser.m

    // Request
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url
                                                  cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData 
                                              timeoutInterval:60];

For some background on the iOS caching dilemma you might check out this article - http://blackpixel.com/blog/2012/05/caching-and-nsurlconnection.html

If either of these options sounds good, I'll go ahead and implement either one, probably Option 2 ultimately for ongoing flexibility.

@normanhh3
Copy link
Author

I ended up removing that commit due to some issues I missed in my first pass. :-( Next commit is a clean compiling and working version.

@mwaterfall
Copy link
Owner

Yep, I'm happy with all of this and it should be included in the main branch shortly. Thanks for the suggestion!

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

2 participants