<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURL/removeAllCachedResourceValues()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURL(im)removeAllCachedResourceValues"
  },
  "title" : "removeAllCachedResourceValues()"
}
-->

# removeAllCachedResourceValues()

Removes all cached resource values and temporary resource values from the URL object.

```
func removeAllCachedResourceValues()
```

## Discussion

This method is applicable only to URLs that represent file system resources.

> Note:
> The caching behavior of the `NSURL` and `CFURL` APIs differ. For `NSURL`, all cached values (not temporary values) are automatically removed after each pass through the run loop. You only need to call the ``doc://com.apple.foundation/documentation/Foundation/NSURL/removeCachedResourceValue(forKey:)`` method when you want to clear the cache within a single execution of the run loop. The `CFURL` functions, on the other hand, do not automatically clear cached resource values. The client has complete control over the cache lifetimes, and you must use <doc://com.apple.documentation/documentation/CoreFoundation/CFURLClearResourcePropertyCacheForKey(_:_:)> or <doc://com.apple.documentation/documentation/CoreFoundation/CFURLClearResourcePropertyCache(_:)> to clear cached resource values.

---

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)