Class PhysicalFileSystemCache
- Namespace
- SixLabors.ImageSharp.Web.Caching
- Assembly
- SixLabors.ImageSharp.Web.dll
Implements a physical file system based cache.
public class PhysicalFileSystemCache : IImageCache
- Inheritance
-
PhysicalFileSystemCache
- Implements
- Inherited Members
Constructors
PhysicalFileSystemCache(IOptions<PhysicalFileSystemCacheOptions>, IWebHostEnvironment, FormatUtilities)
Initializes a new instance of the PhysicalFileSystemCache class.
public PhysicalFileSystemCache(IOptions<PhysicalFileSystemCacheOptions> options, IWebHostEnvironment environment, FormatUtilities formatUtilities)
Parameters
optionsIOptions<PhysicalFileSystemCacheOptions>The cache configuration options.
environmentIWebHostEnvironmentThe hosting environment the application is running in.
formatUtilitiesFormatUtilitiesContains various format helper methods based on the current configuration.
Methods
GetAsync(string)
Gets the image resolver associated with the specified key.
public Task<IImageCacheResolver?> GetAsync(string key)
Parameters
keystringThe cache key.
Returns
SetAsync(string, Stream, ImageCacheMetadata)
Sets the value associated with the specified key.
public Task SetAsync(string key, Stream stream, ImageCacheMetadata metadata)
Parameters
keystringThe cache key.
streamStreamThe stream containing the image to store.
metadataImageCacheMetadataThe ImageCacheMetadata associated with the image to store.
Returns
- Task
The task.