ImageResizer autoclean

217 views Asked by At

I am trying to decrease ImageResizer [IR] cache size. IR are behind the CDN and for now it take about 2 days to grow up disk cache to 200Gb. I found that there is autoclean parameter for DiskCache plugin. I enable it on my pre-prod but it did not affect to the cache. I measure count of files after enabling autoclean: Yesteday, 03:53pm files 5944 folders 2153 Yesteday, 07:10pm files 5980 folders 2199 Today, 11:54am files 6382 folders 2674

What's I am doing wrong? Here is my Web.config:

 <resizer>
    <plugins>
      <add name="S3Reader2" prefix="~/s3" region="eu-west-1" XXX reducted XXX cacheMetadata="false" checkForModifiedFiles="true" cacheUnmodifiedFiles="true" />
      <add name="SimpleFilters" />
      <add name="AdvancedFilters" />
      <add name="DiskCache" />
      
      <add name="PdfRenderer" downloadNativeDependencies="true" />
    </plugins>
<diskcache autoclean="true" CleanupStrategy="14400"/>
    <licenses>
      <license>
        ***reducted****
      </license>
    </licenses>
  </resizer>

1

There are 1 answers

2
Lilith River On

See https://imageresizing.net/docs/v4/plugins/diskcache

The v4 disk cache limits the quantity, not size of files. You can limit the quantity via the subfolders="" setting, which must be a power of two. Roughly 400 files are permitted per subfolder.

<diskcache autoclean="true" subfolders="256"/>