<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLCache/removeCachedResponse(for:)-1dh89",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLCache(im)removeCachedResponseForRequest:"
  },
  "title" : "removeCachedResponse(for:)"
}
-->

# removeCachedResponse(for:)

Removes the cached URL response for a specified URL request.

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

## Discussion

If you override this method, you should also override [`removeCachedResponse(for:)`](/documentation/Foundation/URLCache/removeCachedResponse(for:)-1zwp6).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)