---
title: PHCachingImageManager
framework: photos
role: symbol
role_heading: Class
path: photos/phcachingimagemanager
---

# PHCachingImageManager

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

## Declaration

```swift
class PHCachingImageManager
```

## Mentioned in

Loading and Caching Assets and Thumbnails

## Overview

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 class is defined by its superclass, PHImageManager. For details, see PHImageManager. To use a caching image manager: Create a PHCachingImageManager instance. (This step replaces using the shared PHImageManager instance.) Use PHAsset class methods to fetch the assets you’re interested in. To prepare images for those assets, call the 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. When you need an image for an individual asset, call the 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 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:)](photos/phcachingimagemanager/startcachingimages(for:targetsize:contentmode:options:).md)
- [stopCachingImages(for:targetSize:contentMode:options:)](photos/phcachingimagemanager/stopcachingimages(for:targetsize:contentmode:options:).md)
- [stopCachingImagesForAllAssets()](photos/phcachingimagemanager/stopcachingimagesforallassets().md)

### Setting Cache Policy

- [allowsCachingHighQualityImages](photos/phcachingimagemanager/allowscachinghighqualityimages.md)

## Relationships

### Inherits From

- [PHImageManager](photos/phimagemanager.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Asset loading

- [Loading and Caching Assets and Thumbnails](photokit/loading-and-caching-assets-and-thumbnails.md)
- [PHImageManager](photos/phimagemanager.md)
- [PHImageRequestOptions](photos/phimagerequestoptions.md)
- [PHVideoRequestOptions](photos/phvideorequestoptions.md)
- [PHLivePhotoRequestOptions](photos/phlivephotorequestoptions.md)
