docs/Structs/ResponseCacher.html
public struct ResponseCacher
extension ResponseCacher: CachedResponseHandler
ResponseCacher is a convenience CachedResponseHandler making it easy to cache, not cache, or modify a cached response.
`
Behavior
`
Defines the behavior of the ResponseCacher type.
Swift
public enum Behavior : Sendable
`
cache
`
Returns a ResponseCacher with a .cache Behavior.
Swift
public static let cache: ResponseCacher
`
doNotCache
`
Returns a ResponseCacher with a .doNotCache Behavior.
Swift
public static let doNotCache: ResponseCacher
`
behavior
`
The Behavior of the ResponseCacher.
Swift
public let behavior: Behavior
`
init(behavior:)
`
Creates a ResponseCacher instance from the Behavior.
Swift
public init(behavior: Behavior)
| behavior |
The Behavior.
|
`
dataTask(_:willCacheResponse:completion:)
`
Swift
public func dataTask(_ task: URLSessionDataTask,
willCacheResponse response: CachedURLResponse,
completion: @escaping (CachedURLResponse?) -> Void)