Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ditch the last vestiges of caching for dynamic data sources

  • Loading branch information...
commit 031b0c4febb88dd35a0173f9fdfa27adec95de51 1 parent b5f91bf
@rbruels rbruels authored
View
2  Classes/Data/LoginController.m
@@ -62,7 +62,7 @@ - (void)loginWithUsername:(NSString *)aUsername password:(NSString *)aPassword
TTURLRequest *request = [TTURLRequest requestWithURL:loadURL delegate:self];
request.cacheExpirationAge = 0;
- request.cachePolicy = TTURLRequestCachePolicyNone;
+ request.cachePolicy = TTURLRequestCachePolicyNoCache;
request.response = [[[TTURLDataResponse alloc] init] autorelease];
View
4 Classes/Data/MessageDataSource.m
@@ -159,9 +159,9 @@ - (void)load:(TTURLRequestCachePolicy)cachePolicy more:(BOOL)more
}
activeRequest = [TTURLRequest requestWithURL:loadURL delegate:self];
- activeRequest.cacheExpirationAge = 60 * 2;
activeRequest.shouldHandleCookies = [[LoginController sharedLoginController] isLoggedIn] ? YES : NO;
- activeRequest.cachePolicy = TTURLRequestCachePolicyMemory;
+ activeRequest.cacheExpirationAge = 0;
+ activeRequest.cachePolicy = TTURLRequestCachePolicyNoCache;
activeRequest.response = [[[TTURLDataResponse alloc] init] autorelease];
activeRequest.httpMethod = @"GET";
View
11 Classes/Data/SubredditDataModel.m
@@ -50,18 +50,15 @@ - (void)load:(TTURLRequestCachePolicy)cachePolicy more:(BOOL)more
}
else
{
- // clear the cache for this subreddit
- // sigh... ditch three20 loading asap...
- // clearing the whole cache as even when specifying no cache, things get cached
+ // clear the stories for this subreddit
[self.stories removeAllObjects];
- //[[TTURLCache sharedCache] removeAll:YES];
}
BOOL savedReddit = [self.subreddit isEqual:@"/saved/"];
TTURLRequest *activeRequest = [TTURLRequest requestWithURL:loadURL delegate:self];
- activeRequest.cacheExpirationAge = savedReddit || more ? 0 : 60 * 5;
- activeRequest.cachePolicy = savedReddit || more ? TTURLRequestCachePolicyNone : TTURLRequestCachePolicyDisk;
+ activeRequest.cacheExpirationAge = 0;
+ activeRequest.cachePolicy = TTURLRequestCachePolicyNoCache;
activeRequest.shouldHandleCookies = ([[LoginController sharedLoginController] isLoggedIn] || [[LoginController sharedLoginController] isLoggingIn]) ? YES : NO;
id<TTURLResponse> response = [[TTURLDataResponse alloc] init];
@@ -73,7 +70,7 @@ - (void)load:(TTURLRequestCachePolicy)cachePolicy more:(BOOL)more
}
- (void)requestDidFinishLoad:(TTURLRequest*)request
-{
+{
NSInteger totalCount = [_stories count];
canLoadMore = NO;
View
2  Classes/ViewControllers/MessageViewController.m
@@ -184,7 +184,7 @@ - (void)composeController:(TTMessageController*)controller didSendFields:(NSArra
activeRequest = [TTURLRequest requestWithURL:url delegate:nil];
activeRequest.cacheExpirationAge = 0;
- activeRequest.cachePolicy = TTURLRequestCachePolicyNoCache;
+ activeRequest.cachePolicy = TTURLRequestCachePolicyNoCache;
activeRequest.shouldHandleCookies = [[LoginController sharedLoginController] isLoggedIn] ? YES : NO;
activeRequest.httpMethod = @"POST";
activeRequest.contentType = @"application/x-www-form-urlencoded";
View
1  Classes/Views/StoryCell.m
@@ -19,7 +19,6 @@ + (float)tableView:(UITableView *)aTableView rowHeightForObject:(Story *)aStory
float height = [aStory heightForDeviceMode:[[UIDevice currentDevice] orientation]
withThumbnail:[[NSUserDefaults standardUserDefaults] boolForKey:showStoryThumbnailKey] && [aStory hasThumbnail]] + 46.0;
- NSLog(@"height: %f", height);
if ([[NSUserDefaults standardUserDefaults] boolForKey:showStoryThumbnailKey])
return MAX(height, 68.0);
else
Please sign in to comment.
Something went wrong with that request. Please try again.