Class ImageSharpMiddlewareOptions
Configuration options for the ImageSharpMiddleware middleware.
Inherited Members
Namespace: SixLabors.ImageSharp.Web.Middleware
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public class ImageSharpMiddlewareOptions
Properties
| Improve this Doc View SourceBrowserMaxAge
Gets or sets the duration to store images in the browser cache. If an image provider provides a Max-Age for a source image then that will override this value.
Defaults to 7 days.
Declaration
public TimeSpan BrowserMaxAge { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
CachedNameLength
Gets or sets the length of the filename to use (minus the extension) when storing images in the image cache. Defaults to 12 characters.
Declaration
public uint CachedNameLength { get; set; }
Property Value
Type | Description |
---|---|
UInt32 |
CacheMaxAge
Gets or sets the duration to store images in the image cache.
Defaults to 365 days.
Declaration
public TimeSpan CacheMaxAge { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Configuration
Gets or sets the base library configuration.
Declaration
public Configuration Configuration { get; set; }
Property Value
Type | Description |
---|---|
Configuration |
MemoryStreamManager
Gets or sets the recyclable memorystream manager used for managing pooled stream buffers independently from image buffer pooling.
Declaration
public RecyclableMemoryStreamManager MemoryStreamManager { get; set; }
Property Value
Type | Description |
---|---|
RecyclableMemoryStreamManager |
OnBeforeSaveAsync
Gets or sets the additional method that can be used for final manipulation before the image is saved. This is called after image has been processed, but before the image has been saved to the output stream for caching. This can be used to alter the metadata of the resultant image.
Declaration
public Func<FormattedImage, Task> OnBeforeSaveAsync { get; set; }
Property Value
Type | Description |
---|---|
Func<FormattedImage, Task> |
OnParseCommandsAsync
Gets or sets the additional command parsing method that can be used to used to augment commands. This is called once the commands have been gathered and before an IImageProvider has been assigned.
Declaration
public Func<ImageCommandContext, Task> OnParseCommandsAsync { get; set; }
Property Value
Type | Description |
---|---|
Func<ImageCommandContext, Task> |
OnPrepareResponseAsync
Gets or sets the additional response method. This is called after the status code and headers have been set, but before the body has been written. This can be used to add or change the response headers.
Declaration
public Func<HttpContext, Task> OnPrepareResponseAsync { get; set; }
Property Value
Type | Description |
---|---|
Func<HttpContext, Task> |
OnProcessedAsync
Gets or sets the additional processing method. This is called after image has been processed, but before the result has been cached. This can be used to further optimize the resultant image.
Declaration
public Func<ImageProcessingContext, Task> OnProcessedAsync { get; set; }
Property Value
Type | Description |
---|---|
Func<ImageProcessingContext, Task> |
UseInvariantParsingCulture
Gets or sets a value indicating whether to use culture-independent (invariant) conversion when converting commands. If set to false the CommandParser will use the CurrentCulture.
Declaration
public bool UseInvariantParsingCulture { get; set; }
Property Value
Type | Description |
---|---|
Boolean |