<!--
{
  "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/startCachingImages(for:targetSize:contentMode:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHCachingImageManager(im)startCachingImagesForAssets:targetSize:contentMode:options:"
  },
  "title" : "startCachingImages(for:targetSize:contentMode:options:)"
}
-->

# startCachingImages(for:targetSize:contentMode:options:)

Prepares image representations of the specified assets for later use.

```
func startCachingImages(for assets: [PHAsset], targetSize: CGSize, contentMode: PHImageContentMode, options: PHImageRequestOptions?)
```

## Parameters

`assets`

An array of [`PHAsset`](/documentation/Photos/PHAsset) objects for which to prepare image representations.

`targetSize`

The size of the images to be prepared.

`contentMode`

An option for how to fit the images to the aspect ratio of the requested size. For details, see [`PHImageContentMode`](/documentation/Photos/PHImageContentMode).

`options`

Options specifying how Photos should handle the request, format the requested images, and notify your app of progress or errors. For details, see [`PHImageRequestOptions`](/documentation/Photos/PHImageRequestOptions).

## Discussion

When you call this method, Photos begins to fetch image data and generates thumbnail images on a background thread. At any time afterward, you can use the [`requestImage(for:targetSize:contentMode:options:resultHandler:)`](/documentation/Photos/PHImageManager/requestImage(for:targetSize:contentMode:options:resultHandler:)) method to request individual images from the cache. If Photos has finished preparing a requested image, that method provides the image immediately.

Photos caches images with the exact target size, content mode, and options you specify in this method. If you later request an image with, for example, a different target size than you passed when calling this method, Photos cannot make use of the cache and so it must fetch or generate a new image.

---

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)