RKRequestCache Class Reference
| Inherits from | NSObject |
| Declared in | RKRequestCache.h RKRequestCache.m |
Tasks
Initializating the Cache
-
– initWithPath:storagePolicy:Initializes the receiver with a cache at a given path and storage policy.
Locating the Cache
-
pathReturns the full pathname to the cache.
property -
– pathForRequest:Returns the cache path for the specified request.
-
– hasResponseForRequest:Determine if a response exists for a request.
Populating the Cache
-
– storeResponse:forRequest:Store a request’s response in the cache.
-
– setCacheDate:forRequest:Set the cache date for a request.
Preparing Requests and Responses
-
– headersForRequest:Returns a dictionary of cached headers for a cached request.
-
– etagForRequest:Returns an ETag for a request if it is stored in the cached headers.
-
– cacheDateForRequest:Returns the date of the cached request.
-
– responseForRequest:Returns the cached response for a given request.
Invalidating the Cache
-
storagePolicyThe storage policy for the cache.
property -
– invalidateRequest:Invalidate the cache for a given request.
-
– invalidateWithStoragePolicy:Invalidate any caches that fall under the given storage policy.
-
– invalidateAllInvalidate all caches on disk.
Helpers
-
+ rfc1123DateFormatterThe date formatter used to generate the cache date for the HTTP header.
Properties
Instance Methods
cacheDateForRequest:
Returns the date of the cached request.
- (NSDate *)cacheDateForRequest:(RKRequest *)requestParameters
- request
The request that needs a cache date returned.
Return Value
A date object for the cached request.
Declared In
RKRequestCache.hetagForRequest:
Returns an ETag for a request if it is stored in the cached headers.
- (NSString *)etagForRequest:(RKRequest *)requestParameters
- request
The request that an ETag is to be determined for.
Return Value
A string of the ETag value stored for the specified request.
Declared In
RKRequestCache.hhasResponseForRequest:
Determine if a response exists for a request.
- (BOOL)hasResponseForRequest:(RKRequest *)requestParameters
- request
An RKRequest object that is looking for cached content.
Return Value
A boolean value for if a response exists in the cache.
Declared In
RKRequestCache.hheadersForRequest:
Returns a dictionary of cached headers for a cached request.
- (NSDictionary *)headersForRequest:(RKRequest *)requestParameters
- request
The request to retrieve cached headers for.
Return Value
An NSDictionary of the cached headers that were stored for the specified request.
Declared In
RKRequestCache.hinitWithPath:storagePolicy:
Initializes the receiver with a cache at a given path and storage policy.
- (id)initWithPath:(NSString *)cachePath storagePolicy:(RKRequestCacheStoragePolicy)storagePolicyParameters
- cachePath
The path to store cached data in.
- storagePolicy
The storage policy to use for cached data.
Return Value
An initialized request cache object.
Declared In
RKRequestCache.hinvalidateRequest:
Invalidate the cache for a given request.
- (void)invalidateRequest:(RKRequest *)requestParameters
- request
The request that needs its cache invalidated.
Declared In
RKRequestCache.hinvalidateWithStoragePolicy:
Invalidate any caches that fall under the given storage policy.
- (void)invalidateWithStoragePolicy:(RKRequestCacheStoragePolicy)storagePolicyParameters
- storagePolicy
The RKRequestCacheStorePolicy used to determine which caches need to be invalidated.
Declared In
RKRequestCache.hpathForRequest:
Returns the cache path for the specified request.
- (NSString *)pathForRequest:(RKRequest *)requestReturn Value
A string of the cache path for the specified request.
Declared In
RKRequestCache.hresponseForRequest:
Returns the cached response for a given request.
- (RKResponse *)responseForRequest:(RKRequest *)requestParameters
- request
The request used to find the cached response.
Return Value
An RKResponse object that was cached for a given request.
Declared In
RKRequestCache.h