Instance Method インスタンスメソッド

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. メッセージを送っているURLプロトコルオブジェクト。

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. 実装は、提供されたキャッシュストレージ方針を使って、キャッシュの中の応答を格納するかどうかを決定すべきです。