---
title: "RepositoryCleaners.config | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-editor/it-ops/config-backend/repository-cleaners/"
---

# RepositoryCleaners.config

> The **~/Configuration/RepositoryCleaners.config** file allows you to configure cleanup strategies for the three repositories introduced in Design Atoms 7.3.0: **StateResourcesRepository**, **ArtifactsRepository**, and **StaticFilesRepository**.

## Resource Types

Design Atoms distinguishes three main types of resources:

- **State resources** — design resources saved in state files, including images and complex shapes.
- **Static files** — files sourced from external systems, such as designs, fonts, and color profiles loaded from Asset Storage. Local storages remain unchanged.
- **Artifacts** — rendering results, including proofs and hi-res outputs.

Starting with version 7.3.0, the following are considered temporary files:

- Results of the viewer controller (previews of images, fonts, barcodes, text)
- Image metadata
- Image previews in galleries
- Watermarks (until they become part of the design)
- Images loaded from external links. If the `AllowDownloadImageToCache` configuration parameter is not set, such images are loaded into the cache and do not become part of the design.

These temporary files continue to use `IFileCache`.

## Storage Schema

Prior to version 7.3.0, all file operations used `IFileCache`.

Starting with version 7.3.0, the following packages have been separated:

- `DesignAtoms.Cache.Abstractions`
- `DesignAtoms.Storage.Abstractions`
- `DesignAtoms.Storage.FileSystemStorage`

Out of the box, Design Atoms uses the file system storage implementation (`DesignAtoms.Storage.FileSystemStorage`). However, you can implement additional storage providers (e.g., Azure, AWS) as needed.

In version 7.3.0, three repositories encapsulate file operations:

- **StateResourcesRepository**
- **StaticFilesRepository**
- **ArtifactsRepository**

These repositories implement basic CRUD operations with files and provide several ways to add files. The `StateResourcesRepository` also includes optional cache support, controlled through a configuration parameter. If a client renders many artifacts (read operations significantly exceed write operations), enabling caching allows state resources to be retrieved from the cache first, falling back to permanent storage only on cache misses.

## Working with Resources

Working with files has become slightly more complex. You must always understand which resource type you are working with. Each resource type has its own repository that must be injected into the class that needs to work with that resource type.

## Repository Cleanup

Each repository is cleaned up independently according to its own rules. As of this writing, two cleanup strategies are available:

- **MaxSize** — cleanup when the repository exceeds a threshold.
- **LastAccess** — cleanup based on file obsolescence period.

The cleanup configuration is implemented through the custom `Aurigma.DesignAtoms.RepositoryCleanersConfiguration` section. In Design Editor, this is a separate file: **RepositoryCleaners.config**.

The default configuration file has the following structure:

<pre className="language-xml"><code className="hljs">
&lt;Aurigma.DesignAtoms.RepositoryCleanersConfiguration&gt;
&nbsp;&lt;StateResourcesRepository&gt;
&nbsp;&nbsp;&lt;add key="EnableCleanup" value="true" /&gt;
&nbsp;&nbsp;&lt;add key="CleanupIntervalSeconds" value="3600" /&gt;
&nbsp;&nbsp;&lt;!--Available strategies: MaxSize, LastAccess--&gt;
&nbsp;&nbsp;&lt;add key="CleanupStrategy" value="LastAccess" /&gt;
&nbsp;&nbsp;&lt;!--Parameters for MaxSize strategy--&gt;
&nbsp;&nbsp;&lt;add key="MaxUtilizationThreshold" value="0" /&gt;
&nbsp;&nbsp;&lt;add key="MaxRepositorySizeInBytes" value="0" /&gt;
&nbsp;&nbsp;&lt;add key="UtilizationTarget" value="0" /&gt;
&nbsp;&nbsp;&lt;!--Parameters for LastAccess strategy--&gt;
&nbsp;&nbsp;&lt;add key="LastAccessObsolescencePeriodInHours" value="48" /&gt;
&nbsp;&lt;/StateResourcesRepository&gt;

&nbsp;&lt;ArtifactsRepository&gt;
&nbsp;&nbsp;&lt;add key="EnableCleanup" value="true" /&gt;
&nbsp;&nbsp;&lt;add key="CleanupIntervalSeconds" value="3600" /&gt;
&nbsp;&nbsp;&lt;!--Available strategies: MaxSize, LastAccess--&gt;
&nbsp;&nbsp;&lt;add key="CleanupStrategy" value="MaxSize" /&gt;
&nbsp;&nbsp;&lt;!--Parameters for MaxSize strategy--&gt;
&nbsp;&nbsp;&lt;add key="MaxUtilizationThreshold" value="80" /&gt;
&nbsp;&nbsp;&lt;add key="MaxRepositorySizeInBytes" value="4294967296" /&gt;
&nbsp;&nbsp;&lt;add key="UtilizationTarget" value="50" /&gt;
&nbsp;&nbsp;&lt;!--Parameters for LastAccess strategy--&gt;
&nbsp;&nbsp;&lt;add key="LastAccessObsolescencePeriodInHours" value="0" /&gt;
&nbsp;&lt;/ArtifactsRepository&gt;

&nbsp;&lt;StaticFilesRepository&gt;
&nbsp;&nbsp;&lt;add key="EnableCleanup" value="false" /&gt;
&nbsp;&nbsp;&lt;add key="CleanupIntervalSeconds" value="3600" /&gt;
&nbsp;&nbsp;&lt;!--Available strategies: MaxSize, LastAccess--&gt;
&nbsp;&nbsp;&lt;add key="CleanupStrategy" value="LastAccess" /&gt;
&nbsp;&nbsp;&lt;!--Parameters for MaxSize strategy--&gt;
&nbsp;&nbsp;&lt;add key="MaxUtilizationThreshold" value="0" /&gt;
&nbsp;&nbsp;&lt;add key="MaxRepositorySizeInBytes" value="0" /&gt;
&nbsp;&nbsp;&lt;add key="UtilizationTarget" value="0" /&gt;
&nbsp;&nbsp;&lt;!--Parameters for LastAccess strategy--&gt;
&nbsp;&nbsp;&lt;add key="LastAccessObsolescencePeriodInHours" value="0" /&gt;
&nbsp;&lt;/StaticFilesRepository&gt;
&lt;/Aurigma.DesignAtoms.RepositoryCleanersConfiguration&gt;
</code></pre>

## Common Cleanup Parameters

The following parameters are shared across all repositories:

| Name | Description | Default value |
| :--- | :--- | :--- |
| **EnableCleanup** | Enables or disables the cleanup process for the repository. | `true` |
| **CleanupIntervalSeconds** | The interval between cleanup runs, in seconds. | `3600` |
| **CleanupStrategy** | The cleanup strategy to use. Available values: `MaxSize`, `LastAccess`. | `MaxSize` (ArtifactsRepository), `LastAccess` (other repositories) |

## MaxSize Strategy

When the `MaxSize` strategy is selected, cleanup is triggered based on repository size thresholds:

| Name | Description | Default value |
| :--- | :--- | :--- |
| **MaxUtilizationThreshold** | The maximum utilization percentage before cleanup is triggered. | `80` (ArtifactsRepository), `0` (other repositories) |
| **MaxRepositorySizeInBytes** | The maximum repository size in bytes. | `4294967296` (ArtifactsRepository), `0` (other repositories) |
| **UtilizationTarget** | The utilization level (in percent) to which the repository should be cleaned up. When the cleanup algorithm reaches the `UtilizationTarget` level, the cleanup process stops. | `50` (ArtifactsRepository), `0` (other repositories) |

## LastAccess Strategy

When the `LastAccess` strategy is selected, cleanup is triggered based on the last access date of files:

| Name | Description | Default value |
| :--- | :--- | :--- |
| **LastAccessObsolescencePeriodInHours** | The number of hours after which files are considered obsolete and eligible for cleanup. | `48` (StateResourcesRepository), `0` (other repositories) |
