Disabling HTTP pipelining for image request operations
This commit is contained in:
parent
bec09ed3a3
commit
fc16eef8b2
2 changed files with 2 additions and 3 deletions
|
|
@ -36,7 +36,7 @@
|
||||||
/**
|
/**
|
||||||
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL, and sets it the request is finished. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
Creates and enqueues an image request operation, which asynchronously downloads the image from the specified URL, and sets it the request is finished. Any previous image request for the receiver will be cancelled. If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
|
||||||
|
|
||||||
@discussion By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set to use HTTP pipelining, and not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
@discussion By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
||||||
|
|
||||||
@param url The URL used for the image request.
|
@param url The URL used for the image request.
|
||||||
*/
|
*/
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
@param url The URL used for the image request.
|
@param url The URL used for the image request.
|
||||||
@param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
|
@param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
|
||||||
|
|
||||||
@discussion By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set to use HTTP pipelining, and not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
@discussion By default, URL requests have a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
|
||||||
*/
|
*/
|
||||||
- (void)setImageWithURL:(NSURL *)url
|
- (void)setImageWithURL:(NSURL *)url
|
||||||
placeholderImage:(UIImage *)placeholderImage;
|
placeholderImage:(UIImage *)placeholderImage;
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,6 @@ static char kAFImageRequestOperationObjectKey;
|
||||||
{
|
{
|
||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
|
||||||
[request setHTTPShouldHandleCookies:NO];
|
[request setHTTPShouldHandleCookies:NO];
|
||||||
[request setHTTPShouldUsePipelining:YES];
|
|
||||||
[request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
|
[request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
|
||||||
|
|
||||||
[self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
|
[self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue