Caching for resized images in blob storage
Requires ImageResizer 4.0.1 or above
install-package ImageResizer.Plugins.AzureBlobCache
The following will be added to web.config
<configuration>
<resizer>
<plugins>
<add name="AzureBlobCache" />
</plugins>
</resizer>
</configuration>
For detailed settings an <azureBlobCache>
element can be provided inside <resizer>
<configuration>
<resizer>
...
<azureBlobCache connectionName="ResizerAzureBlobs" memoryStoreLimitMb="200" indexMaxItems="200000" />
<plugins>
...
<add name="AzureBlobCache" />
</plugins>
</resizer>
</configuration>
This element has a list of attributes that can be provided for detailed control over plugin behaviour.
Parameter | Description | Default value |
---|---|---|
connectionName | Name of connection to Azure blob storage in connectionStrings.config . |
"ResizerAzureBlobs" |
containerName | Name of the container where cache blobs are to be stored. | "imagecache" |
timeoutSeconds | Seconds before attempt to fetch cache item is aborted (after which the underlying image is returned normally). | 5 |
logging | If logging should be enabled or not, set to either true or false (requires either ImageResizer.Plugins.Logging or ImageResizer.Plugins.Log4net ). |
false |
memoryStoreLimitMb | If provided, a memory cache is created, where recent cache items are kept (for increased performance). | |
memoryStoreSlidingExpiration | The sliding expiration time of a cache item in System.TimeSpan format ("HH:MM:SS" ). |
"00:30:00" |
memoryStoreAbsoluteExpiration | The absolute expiration time of a cache item (overrides sliding expiration if provided "HH:MM:SS" ). |
|
memoryStorePollingInterval | If a memory cache exists, the memory cache will be updated in the given interval ("HH:MM:SS" ). Additional details about memory cache configuration can be found here. |
"00:04:01" |
indexMaxSizeMb | If provided, the size of the index will be monitored and cleaned as not to exceed given size (in MB). | |
indexMaxItems | If provided, the items in index will be monitored and cleaned as not to exceed given count (of items). | |
indexPollingInterval | The interval in which the index max size should be checked ("HH:MM:SS" ). |
"00:05:00" |
indexDatabaseConnectionName | Not configurable. The index monitoring uses SQL, if index is set up, this is the name of the connection string to the created EntityFramework context. | "ResizerEFConnection" |
Requires ImageResizer to be configured with ImageResizer.AsyncInterceptModule
.
If ImageResizer.InterceptModule
is configured, replace all instances of this
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
with this
<add name="ImageResizingModule" type="ImageResizer.AsyncInterceptModule" />
For this plugin to work with Optimizely (formerly EPiServer), at least version 7.3.1
of ImageResizer.Plugins.EPiServerBlobReader
needs to be installed.