Class PhysicalFileSystemCache
Implements a physical file system based cache.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Web.Caching
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public class PhysicalFileSystemCache : IImageCache
Constructors
| Edit this page View SourcePhysicalFileSystemCache(IOptions<PhysicalFileSystemCacheOptions>, IWebHostEnvironment, FormatUtilities)
Initializes a new instance of the PhysicalFileSystemCache class.
Declaration
public PhysicalFileSystemCache(IOptions<PhysicalFileSystemCacheOptions> options, IWebHostEnvironment environment, FormatUtilities formatUtilities)
Parameters
Type | Name | Description |
---|---|---|
IOptions<PhysicalFileSystemCacheOptions> | options | The cache configuration options. |
IWebHostEnvironment | environment | The hosting environment the application is running in. |
FormatUtilities | formatUtilities | Contains various format helper methods based on the current configuration. |
Methods
| Edit this page View SourceGetAsync(string)
Gets the image resolver associated with the specified key.
Declaration
public Task<IImageCacheResolver?> GetAsync(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The cache key. |
Returns
Type | Description |
---|---|
Task<IImageCacheResolver> | The IImageResolver. |
SetAsync(string, Stream, ImageCacheMetadata)
Sets the value associated with the specified key.
Declaration
public Task SetAsync(string key, Stream stream, ImageCacheMetadata metadata)
Parameters
Type | Name | Description |
---|---|---|
string | key | The cache key. |
Stream | stream | The stream containing the image to store. |
ImageCacheMetadata | metadata | The ImageCacheMetadata associated with the image to store. |
Returns
Type | Description |
---|---|
Task | The task. |