---
title: "removeCachedResponse(for:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/urlcache/removecachedresponse(for:)-1dh89"
---

# removeCachedResponse(for:)

Removes the cached URL response for a specified URL request.

## Declaration

```swift
func removeCachedResponse(for request: URLRequest)
```

## Parameters

- `request`: The URL request whose cached URL response should be removed. If there is no corresponding cached URL response, no action is taken.

## Mentioned in

Accessing cached data

## Discussion

Discussion If you override this method, you should also override removeCachedResponse(for:).

## See Also

### Removing cached objects

- [removeCachedResponse(for:)](foundation/urlcache/removecachedresponse(for:)-1zwp6.md)
- [removeCachedResponses(since:)](foundation/urlcache/removecachedresponses(since:).md)
- [removeAllCachedResponses()](foundation/urlcache/removeallcachedresponses().md)
