![]() |
Ignite Tools
|
00001 // 00002 // UA_ASIDownloadCache.h 00003 // Part of UA_ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest 00004 // 00005 // Created by Ben Copsey on 01/05/2010. 00006 // Copyright 2010 All-Seeing Interactive. All rights reserved. 00007 // 00008 00009 #import <Foundation/Foundation.h> 00010 #import "UA_ASICacheDelegate.h" 00011 00012 @interface UA_ASIDownloadCache : NSObject <UA_ASICacheDelegate> { 00013 00014 // The default cache policy for this cache 00015 // Requests that store data in the cache will use this cache policy if their cache policy is set to ASIDefaultCachePolicy 00016 // Defaults to ASIReloadIfDifferentCachePolicy 00017 UA_ASICachePolicy defaultCachePolicy; 00018 00019 // The directory in which cached data will be stored 00020 // Defaults to a directory called 'ASIHTTPRequestCache' in the temporary directory 00021 NSString *storagePath; 00022 00023 // Mediates access to the cache 00024 NSRecursiveLock *accessLock; 00025 00026 // When YES, the cache will look for cache-control / pragma: no-cache headers, and won't reuse store responses if it finds them 00027 BOOL shouldRespectCacheControlHeaders; 00028 } 00029 00030 // Returns a static instance of an UA_ASIDownloadCache 00031 // In most circumstances, it will make sense to use this as a global cache, rather than creating your own cache 00032 // To make ASIHTTPRequests use it automatically, use [UA_ASIHTTPRequest setDefaultCache:[UA_ASIDownloadCache sharedCache]]; 00033 + (id)sharedCache; 00034 00035 // A helper function that determines if the server has requested data should not be cached by looking at the request's response headers 00036 + (BOOL)serverAllowsResponseCachingForRequest:(UA_ASIHTTPRequest *)request; 00037 00038 // A date formatter that can be used to construct an RFC 1123 date 00039 // The returned formatter is safe to use on the calling thread 00040 // Do not use this formatter for parsing dates because the format can vary slightly - use UA_ASIHTTPRequest's dateFromRFC1123String: class method instead 00041 + (NSDateFormatter *)rfc1123DateFormatter; 00042 00043 @property (assign, nonatomic) UA_ASICachePolicy defaultCachePolicy; 00044 @property (retain, nonatomic) NSString *storagePath; 00045 @property (retain) NSRecursiveLock *accessLock; 00046 @property (assign) BOOL shouldRespectCacheControlHeaders; 00047 @end