1. 程式人生 > >iOS最全效能優化(中)

iOS最全效能優化(中)

+ (NSMutableURLRequest *)imageRequestWithURL:(NSURL *)url { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; request.cachePolicy = NSURLRequestReturnCacheDataElseLoad;// this will make sure the request always returns the cached image request.HTTPShouldHandleCookies
= NO; request.HTTPShouldUsePipelining = YES; [request addValue:@"image/*"forHTTPHeaderField:@"Accept"]; returnrequest; }