Class AWSS3StorageCache
Implements an AWS S3 Storage based cache.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Web.Caching.AWS
Assembly: SixLabors.ImageSharp.Web.Providers.AWS.dll
Syntax
public class AWSS3StorageCache : IImageCache
Constructors
| Edit this page View SourceAWSS3StorageCache(IOptions<AWSS3StorageCacheOptions>)
Initializes a new instance of the AWSS3StorageCache class.
Declaration
public AWSS3StorageCache(IOptions<AWSS3StorageCacheOptions> cacheOptions)
Parameters
Type | Name | Description |
---|---|---|
IOptions<AWSS3StorageCacheOptions> | cacheOptions | The cache options. |
Methods
| Edit this page View SourceCreateIfNotExists(AWSS3StorageCacheOptions, S3CannedACL)
Creates a new bucket under the specified account if a bucket with the same name does not already exist.
Declaration
public static PutBucketResponse? CreateIfNotExists(AWSS3StorageCacheOptions options, S3CannedACL acl)
Parameters
Type | Name | Description |
---|---|---|
AWSS3StorageCacheOptions | options | The AWS S3 Storage cache options. |
S3CannedACL | acl | Specifies whether data in the bucket may be accessed publicly and the level of access. Amazon.S3.S3CannedACL.PublicRead specifies full public read access for bucket and object data. Amazon.S3.S3CannedACL.Private specifies that the bucket data is private to the account owner. |
Returns
Type | Description |
---|---|
PutBucketResponse | If the bucket does not already exist, a Amazon.S3.Model.PutBucketResponse describing the newly created bucket. If the container already exists, null. |
GetAsync(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. |