---
title: "CachePolicy"
description: "CachePolicy"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/swift/reference/cachepolicy"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-20"
---

# CachePolicy

## CachePolicy

The cache policies allow you to define the source from where the SDK will retrieve the content.

The SDK retrieves data through a network call, and saves the retrieved data in the cache. This is set as the default policy.

The SDK gets data from the cache.

The SDK gets data from the cache. However, if it fails to retrieve data from the cache, it makes a network call.

The SDK gets data using a network call. However, if the call fails, it retrieves data from cache.

The SDK gets data from cache, and then makes a network call. (A success callback will be invoked twice.

## CachePolicy | Swift Delivery SDK | Contentstack

The CachePolicy enum in the Swift Delivery SDK defines the source from which the SDK retrieves content, letting you control caching behavior for requests.