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
| Improve this Doc View SourcePhysicalFileSystemCache(IOptions<PhysicalFileSystemCacheOptions>, IWebHostEnvironment, IOptions<ImageSharpMiddlewareOptions>, FormatUtilities)
Initializes a new instance of the PhysicalFileSystemCache class.
Declaration
public PhysicalFileSystemCache(IOptions<PhysicalFileSystemCacheOptions> cacheOptions, IWebHostEnvironment environment, IOptions<ImageSharpMiddlewareOptions> options, FormatUtilities formatUtilities)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IOptions<PhysicalFileSystemCacheOptions> | cacheOptions | The cache configuration options.  | 
      
| IWebHostEnvironment | environment | The hosting environment the application is running in.  | 
      
| IOptions<ImageSharpMiddlewareOptions> | options | The middleware configuration options.  | 
      
| FormatUtilities | formatUtilities | Contains various format helper methods based on the current configuration.  | 
      
Methods
| Improve this Doc 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 async 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.  |