Clear Pixel Cache (Data Management)


Clears the pixel cache associated with a mosaic dataset.

The pixel cache for a mosaic dataset can be generated by running the Add Rasters to Mosaic Dataset tool with the Enable Pixel Cache parameter checked. The pixel cache improves the performance when viewing and performing analysis on a mosaic that references rasters on cloud or slow Network Attached Storage (NAS). The cache is stored on the local machine, improving performance.


  • This tool allows you to manage the generated cache of a mosaic dataset by deleting the pixel cache.


    The cache cannot be deleted if the mosaic dataset is open in the map.

  • The pixel cache will be regenerated from the source when the mosaic dataset is reviewed.


ClearPixelCache(in_mosaic_dataset, {generated_before})
ParameterExplanationData Type

The input mosaic dataset with the pixel cache to be deleted.

Mosaic Dataset

All cache generated before this date will be deleted.


Code sample

ClearPixelCache example 1 (Python window)

This is a Python sample for the ClearPixelCache tool.

import arcpy

arcpy.ClearPixelCache_management("c:\\test\\outputdatabase.gdb\mosaicdataset", "10/24/2018 4:15:38 PM")
ClearPixelCache example 2 (stand-alone script)

This is a Python script sample for the ClearPixelCache tool.

#Clear Pixel Cache
'''Usage: ClearPixelCache_management(in_mosaic_dataset, {generated_before})'''

import arcpy

#Clear Pixel Cache
mdname = r"c:\test\Clearpixelcahce.gdb\mosaicdataset"
date = "10/25/2018"

arcpy.ClearPixelCache_management(mdname, date)


This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics