<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageIO",
  "identifier" : "/documentation/ImageIO/kCGImageSourceShouldCache",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@kCGImageSourceShouldCache"
  },
  "title" : "kCGImageSourceShouldCache"
}
-->

# kCGImageSourceShouldCache

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

```
let kCGImageSourceShouldCache: CFString
```

## Discussion

The value of this key is a <doc://com.apple.documentation/documentation/CoreFoundation/CFBoolean>. The default value is <doc://com.apple.documentation/documentation/CoreFoundation/kCFBooleanTrue> for 64-bit architectures, and <doc://com.apple.documentation/documentation/CoreFoundation/kCFBooleanFalse> for 32-bit architectures.

Include this key in the options dictionary you pass to the functions [`CGImageSourceCopyPropertiesAtIndex(_:_:_:)`](/documentation/ImageIO/CGImageSourceCopyPropertiesAtIndex(_:_:_:)) and [`CGImageSourceCreateImageAtIndex(_:_:_:)`](/documentation/ImageIO/CGImageSourceCreateImageAtIndex(_:_:_:)).

---

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)