---
title: kCGImageSourceShouldCacheImmediately
framework: imageio
role: symbol
role_heading: Global Variable
path: imageio/kcgimagesourceshouldcacheimmediately
---

# kCGImageSourceShouldCacheImmediately

A Boolean value that indicates whether image decoding and caching happens at image creation time.

## Declaration

```swift
let kCGImageSourceShouldCacheImmediately: CFString
```

## Discussion

Discussion The value of this key is a CFBoolean. The default value is kCFBooleanFalse, which causes decoding and caching to happen only when you render the image. 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)
- [kCGImageSourceShouldCache](imageio/kcgimagesourceshouldcache.md)
- [kCGImageSourceCreateThumbnailFromImageIfAbsent](imageio/kcgimagesourcecreatethumbnailfromimageifabsent.md)
- [kCGImageSourceCreateThumbnailFromImageAlways](imageio/kcgimagesourcecreatethumbnailfromimagealways.md)
- [kCGImageSourceThumbnailMaxPixelSize](imageio/kcgimagesourcethumbnailmaxpixelsize.md)
- [kCGImageSourceCreateThumbnailWithTransform](imageio/kcgimagesourcecreatethumbnailwithtransform.md)
- [kCGImageSourceSubsampleFactor](imageio/kcgimagesourcesubsamplefactor.md)
