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
AllowDownloadImageToCacheconfiguration 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.AbstractionsDesignAtoms.Storage.AbstractionsDesignAtoms.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:
<Aurigma.DesignAtoms.RepositoryCleanersConfiguration>
<StateResourcesRepository>
<add key="EnableCleanup" value="true" />
<add key="CleanupIntervalSeconds" value="3600" />
<!--Available strategies: MaxSize, LastAccess-->
<add key="CleanupStrategy" value="MaxSize" />
<!--Parameters for MaxSize strategy-->
<add key="MaxUtilizationThreshold" value="95" />
<add key="MaxRepositorySizeInBytes" value="95" />
<add key="MaxRepositorySize" value="4294967296" />
<!--Parameters for LastAccess strategy-->
<add key="LastAccessObsolescencePeriodInDays" value="0" />
</StateResourcesRepository>
<ArtifactsRepository>
<add key="EnableCleanup" value="true" />
<add key="CleanupIntervalSeconds" value="3600" />
<!--Available strategies: MaxSize, LastAccess-->
<add key="CleanupStrategy" value="LastAccess" />
<!--Parameters for MaxSize strategy-->
<add key="MaxUtilizationThreshold" value="95" />
<add key="MaxRepositorySizeInBytes" value="95" />
<add key="MaxRepositorySize" value="95" />
<!--Parameters for LastAccess strategy-->
<add key="LastAccessObsolescencePeriodInDays" value="3" />
</ArtifactsRepository>
<StaticFilesRepository>
<add key="EnableCleanup" value="false" />
<add key="CleanupIntervalSeconds" value="3600" />
<!--Available strategies: MaxSize, LastAccess-->
<add key="CleanupStrategy" value="LastAccess" />
<!--Parameters for MaxSize strategy-->
<add key="MaxUtilizationThreshold" value="95" />
<add key="MaxRepositorySizeInBytes" value="95" />
<add key="MaxRepositorySize" value="95" />
<!--Parameters for LastAccess strategy-->
<add key="LastAccessObsolescencePeriodInDays" value="0" />
</StaticFilesRepository>
</Aurigma.DesignAtoms.RepositoryCleanersConfiguration>
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 |
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. | 95 |
| MaxRepositorySizeInBytes | The maximum repository size in bytes. | 95 |
| MaxRepositorySize | The maximum repository size. | 4294967296 |
LastAccess Strategy
When the LastAccess strategy is selected, cleanup is triggered based on the last access date of files:
| Name | Description | Default value |
|---|---|---|
| LastAccessObsolescencePeriodInDays | The number of days after which files are considered obsolete and eligible for cleanup. | 0 |