---
title: kCGImageSourceShouldCache
framework: imageio
role: symbol
role_heading: Global Variable
path: imageio/kcgimagesourceshouldcache
---

# kCGImageSourceShouldCache

A Boolean value that indicates whether to cache the decoded image.

## Declaration

```swift
let kCGImageSourceShouldCache: CFString
```

## Discussion

Discussion The value of this key is a CFBoolean. The default value is kCFBooleanTrue for 64-bit architectures, and kCFBooleanFalse for 32-bit architectures. Include this key in the options dictionary you pass to the functions CGImageSourceCopyPropertiesAtIndex(_:_:_:) and CGImageSourceCreateImageAtIndex(_:_:_:).

## See Also

### Specifying the Read Options

- [kCGImageSourceTypeIdentifierHint](imageio/kcgimagesourcetypeidentifierhint.md)
- [kCGImageSourceShouldAllowFloat](imageio/kcgimagesourceshouldallowfloat.md)
- [kCGImageSourceShouldCacheImmediately](imageio/kcgimagesourceshouldcacheimmediately.md)
- [kCGImageSourceCreateThumbnailFromImageIfAbsent](imageio/kcgimagesourcecreatethumbnailfromimageifabsent.md)
- [kCGImageSourceCreateThumbnailFromImageAlways](imageio/kcgimagesourcecreatethumbnailfromimagealways.md)
- [kCGImageSourceThumbnailMaxPixelSize](imageio/kcgimagesourcethumbnailmaxpixelsize.md)
- [kCGImageSourceCreateThumbnailWithTransform](imageio/kcgimagesourcecreatethumbnailwithtransform.md)
- [kCGImageSourceSubsampleFactor](imageio/kcgimagesourcesubsamplefactor.md)
