Contents

urlProtocol(_:didReceive:cacheStoragePolicy:)

Tells the client that the protocol implementation has created a response object for the request.

Declaration

func urlProtocol(_ protocol: URLProtocol, didReceive response: URLResponse, cacheStoragePolicy policy: URLCache.StoragePolicy)

Parameters

  • protocol:

    The URL protocol object sending the message.

  • response:

    The newly available response object.

  • policy:

    The cache storage policy for the response.

Discussion

The implementation should use the provided cache storage policy to determine whether to store the response in a cache.