<!--
{
  "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/NSURLRequest/CachePolicy-swift.enum/useProtocolCachePolicy",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSURLRequestCachePolicy@NSURLRequestUseProtocolCachePolicy"
  },
  "title" : "NSURLRequest.CachePolicy.useProtocolCachePolicy"
}
-->

# NSURLRequest.CachePolicy.useProtocolCachePolicy

Use the caching logic defined in the protocol implementation, if any, for a particular URL load request.

```
case useProtocolCachePolicy
```

## Discussion

This is the default policy for URL load requests.

### HTTP caching behavior

For the HTTP and HTTPS protocols, [`NSURLRequest.CachePolicy.useProtocolCachePolicy`](/documentation/Foundation/NSURLRequest/CachePolicy-swift.enum/useProtocolCachePolicy) performs the following behavior:

1. If a cached response does not exist for the request, the URL loading system fetches the data from the originating source.
2. Otherwise, if the cached response does not indicate that it must be revalidated every time, and if the cached response is not stale (past its expiration date), the URL loading system returns the cached response.
3. If the cached response is stale or requires revalidation, the URL loading system makes a HEAD request to the originating source to see if the resource has changed. If so, the URL loading system fetches the data from the originating source. Otherwise, it returns the cached response.

This behavior is illustrated in the figure below.

![Flow chart starting with “need to determine whether to return a cached response”, and then considering various factors to determine whether to return a cached response or to fetch it anew.](images/com.apple.foundation/media-2994170@2x.png)

> Note:
> For the formal definition of these semantics, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13).

> Important:
> If you are making HTTP or HTTPS byte-range requests, always use the ``doc://com.apple.foundation/documentation/Foundation/NSURLRequest/CachePolicy-swift.enum/reloadIgnoringLocalCacheData`` policy instead.

---

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)