---
title: requestCachePolicy
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessionconfiguration/requestcachepolicy
---

# requestCachePolicy

A predefined constant that determines when to return a response from the cache.

## Declaration

```swift
var requestCachePolicy: NSURLRequest.CachePolicy { get set }
```

## Mentioned in

Accessing cached data

## Discussion

Discussion This property determines the request caching policy used by tasks within sessions based on this configuration. Set this property to one of the constants defined in NSURLRequest.CachePolicy to specify whether the cache policy should depend on expiration dates and age, whether the cache should be disabled entirely, and whether the server should be contacted to determine if the content has changed since it was last requested. The default value is NSURLRequest.CachePolicy.useProtocolCachePolicy.

## See Also

### Setting caching policies

- [urlCache](foundation/urlsessionconfiguration/urlcache.md)
