public class NSURLCache extends NSObject
| Constructor and Description |
|---|
NSURLCache(int memoryCapacity,
int diskCapacity,
String path)
Constructs a cache object with the specified memory and disk
capacity,located to the specified path.
|
| Modifier and Type | Method and Description |
|---|---|
int |
currentDiskUsage()
Returns the current size of the disk.
|
int |
currentMemoryUsage()
Returns the current size of the cache on the disk.
|
int |
diskCapacity()
Returns the capacity of the cache on the disk.
|
int |
memoryCapacity()
Returns the capacity of the cache object.
|
void |
removeAllCachedResponses()
Clears the cache.
|
void |
removeCachedResponseForRequest(NSURLRequest request)
Removes the cached URL response for a specified URL request.
|
void |
setDiskCapacity(int diskCapacity)
Sets the size of the cache on the disk.
|
void |
setMemoryCapacity(int memoryCapacity)
Sets the memory capacity of the cache object.
|
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKeypublic NSURLCache(int memoryCapacity,
int diskCapacity,
String path)
memoryCapacity - The memory capacity of the object.diskCapacity - The disk capacity of the object.path - The location on the disk of the cache object.public void setMemoryCapacity(int memoryCapacity)
memoryCapacity - The memory capacity of the cache object in bytes.public int memoryCapacity()
public int currentMemoryUsage()
public void setDiskCapacity(int diskCapacity)
diskCapacity - The size of the cache on the disk in bytes.public int diskCapacity()
public int currentDiskUsage()
public void removeAllCachedResponses()
public void removeCachedResponseForRequest(NSURLRequest request)
request - The URL request for which the responses are removed.Copyright © 2020. All rights reserved.