<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHCachingImageManager",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHCachingImageManager"
  },
  "title" : "PHCachingImageManager"
}
-->

# PHCachingImageManager

An object that facilitates retrieving or generating preview thumbnails, optimized for batch preloading large numbers of assets.

```
class PHCachingImageManager
```

## Overview

For quick performance when you are working with many assets, a caching image manager can prepare asset images in the background in order to eliminate delays when you later request individual images. For example, use a caching image manager when you want to populate a collection view or similar UI with thumbnails of photo or video assets.

Much of the key functionality of the [`PHCachingImageManager`](/documentation/Photos/PHCachingImageManager) class is defined by its superclass, [`PHImageManager`](/documentation/Photos/PHImageManager). For details, see [`PHImageManager`](/documentation/Photos/PHImageManager).

To use a caching image manager:

1. Create a [`PHCachingImageManager`](/documentation/Photos/PHCachingImageManager) instance. (This step replaces using the shared [`PHImageManager`](/documentation/Photos/PHImageManager) instance.)
2. Use [`PHAsset`](/documentation/Photos/PHAsset) class methods to fetch the assets you’re interested in.
3. To prepare images for those assets, call the [`startCachingImages(for:targetSize:contentMode:options:)`](/documentation/Photos/PHCachingImageManager/startCachingImages(for:targetSize:contentMode:options:)) method with the target size, content mode, and options you plan to use when later requesting images for each individual asset.
4. When you need an image for an individual asset, call the [`requestImage(for:targetSize:contentMode:options:resultHandler:)`](/documentation/Photos/PHImageManager/requestImage(for:targetSize:contentMode:options:resultHandler:)) method, and pass the same parameters you used when preparing that asset.

If the image you request is among those already prepared, the [`PHCachingImageManager`](/documentation/Photos/PHCachingImageManager) object immediately returns that image. Otherwise, Photos prepares the image on demand and caches it for later use.

## Topics

### Preparing Images

[`startCachingImages(for:targetSize:contentMode:options:)`](/documentation/Photos/PHCachingImageManager/startCachingImages(for:targetSize:contentMode:options:))

Prepares image representations of the specified assets for later use.

[`stopCachingImages(for:targetSize:contentMode:options:)`](/documentation/Photos/PHCachingImageManager/stopCachingImages(for:targetSize:contentMode:options:))

Cancels image preparation for the specified assets and options.

[`stopCachingImagesForAllAssets()`](/documentation/Photos/PHCachingImageManager/stopCachingImagesForAllAssets())

Cancels all image preparation that is currently in progress.

### Setting Cache Policy

[`allowsCachingHighQualityImages`](/documentation/Photos/PHCachingImageManager/allowsCachingHighQualityImages)

A Boolean value that determines whether the image manager prepares high-quality images.



---

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)