---
title: "urlProtocol(_:didReceive:cacheStoragePolicy:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/urlprotocolclient/urlprotocol(_:didreceive:cachestoragepolicy:)"
---

# urlProtocol(_:didReceive:cacheStoragePolicy:)

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

## Declaration

```swift
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

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