Type Method

requestIsCacheEquivalent(_:to:)

A Boolean value indicating whether two requests are equivalent for cache purposes.

Declaration

class func requestIsCacheEquivalent(_ a: URLRequest, to b: URLRequest) -> Bool

Parameters

aRequest

The request to compare with bRequest.

bRequest

The request to compare with aRequest.

Return Value

true if aRequest and bRequest are equivalent for cache purposes, false otherwise.

Discussion

Requests are considered equivalent for cache purposes if and only if they would be handled by the same protocol and that protocol declares them equivalent after performing implementation-specific checks.

The URLProtocol implementation of this method compares the URLs of the requests to determine if the requests should be considered equivalent. Subclasses can override this method to provide protocol-specific comparisons.