<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLCache/StoragePolicy",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSURLCacheStoragePolicy"
  },
  "title" : "URLCache.StoragePolicy"
}
-->

# URLCache.StoragePolicy

These constants specify the caching strategy used by an [`CachedURLResponse`](/documentation/Foundation/CachedURLResponse) object.

```
enum StoragePolicy
```

## Topics

### Policies

[`URLCache.StoragePolicy.allowed`](/documentation/Foundation/URLCache/StoragePolicy/allowed)

Storage in [`URLCache`](/documentation/Foundation/URLCache) is allowed without restriction.

[`URLCache.StoragePolicy.allowedInMemoryOnly`](/documentation/Foundation/URLCache/StoragePolicy/allowedInMemoryOnly)

Storage in [`URLCache`](/documentation/Foundation/URLCache) is allowed; however storage should be restricted to memory only.

[`URLCache.StoragePolicy.notAllowed`](/documentation/Foundation/URLCache/StoragePolicy/notAllowed)

Storage in [`URLCache`](/documentation/Foundation/URLCache) is not allowed in any fashion, either in memory or on disk.



---

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)