Skip to content

Commit 1d790c7

Browse files
Update README.md
1 parent 425c7b9 commit 1d790c7

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Umbraco storage providers
22
This repository contains Umbraco storage providers that can replace the default physical file storage.
33

4-
> **Note** For Umbraco 9, use version 1 and [follow the version-specific documentation](https://github.com/umbraco/Umbraco.StorageProviders/blob/support/1.1.x/README.md).
4+
> **Note**
5+
> Use the following documentation for previous Umbraco CMS versions:
6+
> * [Umbraco CMS 10 - v10](https://github.com/umbraco/Umbraco.StorageProviders/blob/support/10.0.x/README.md)
7+
> * [Umbraco CMS 9 - v1](https://github.com/umbraco/Umbraco.StorageProviders/blob/support/1.1.x/README.md)
58
69
## Umbraco.StorageProviders
710
Contains shared storage providers infrastructure, like a CDN media URL provider.
@@ -48,10 +51,11 @@ UMBRACO__STORAGE__CDN__URL=https://cdn.example.com/
4851
UMBRACO__STORAGE__CDN__REMOVEMEDIAFROMPATH=true
4952
```
5053

51-
> **Note** You still have to add the provider in the `Startup.cs` file when not configuring the options in code.
54+
> **Note**
55+
> You still have to add the provider in the `Startup.cs` file when not configuring the options in code.
5256
5357
### Configuration
54-
Configure your CDN origin to point to your site and ensure every unique URL is cached (includes the query string), so images can be processed by the site (using ImageSharp) and the response cached by the CDN.
58+
Configure your CDN origin to point to your site and ensure every unique URL is cached (includes the query string), so images can be processed by the site and the response cached by the CDN.
5559

5660
By default, the CDN provider removes the media path (`/media`) from the generated media URL, so you need to configure your CDN origin to include this path. This is to prevent caching/proxying other parts of your site, but you can opt-out of this behavior by setting `RemoveMediaFromPath` to `false`.
5761

@@ -67,7 +71,7 @@ public void ConfigureServices(IServiceCollection services)
6771
.AddBackOffice()
6872
.AddWebsite()
6973
.AddComposers()
70-
+ .AddAzureBlobMediaFileSystem()
74+
+ .AddAzureBlobMediaFileSystem()
7175
.Build();
7276
}
7377
```
@@ -102,14 +106,41 @@ UMBRACO__STORAGE__AZUREBLOB__MEDIA__CONNECTIONSTRING=UseDevelopmentStorage=true
102106
UMBRACO__STORAGE__AZUREBLOB__MEDIA__CONTAINERNAME=sample-container
103107
```
104108

105-
> **Note** You still have to add the provider in the `Startup.cs` file when not configuring the options in code.
109+
> **Note**
110+
> You still have to add the provider in the `Startup.cs` file when not configuring the options in code.
106111
107-
### Folder structure in the Azure Blob Storage container
112+
## Umbraco.StorageProviders.AzureBlob.ImageSharp
113+
Adds ImageSharp support for storing the image cache to a pre-configured Azure Blob Storage provider.
114+
115+
### Usage
116+
This provider can be added in the `Startup.cs` file:
117+
```diff
118+
public void ConfigureServices(IServiceCollection services)
119+
{
120+
services.AddUmbraco(_env, _config)
121+
.AddBackOffice()
122+
.AddWebsite()
123+
.AddComposers()
124+
.AddAzureBlobMediaFileSystem()
125+
+ .AddAzureBlobImageSharpCache()
126+
.Build();
127+
}
128+
```
129+
130+
By default the media file system configuration will be used and files will be stored in a separate folder ([see below](#folder-structure-in-the-azure-blob-storage-container)). You can specify the name of another (already configured) Azure Blob file system to store the files in another container:
131+
```csharp
132+
.AddAzureBlobFileSystem("Cache")
133+
.AddAzureBlobImageSharpCache("Cache")
134+
```
135+
136+
137+
## Folder structure in the Azure Blob Storage container
108138
The container name is expected to exist and uses the following folder structure:
109139
- `/media` - contains the Umbraco media, stored in the structure defined by the `IMediaPathScheme` registered in Umbraco (the default `UniqueMediaPathScheme` stores files with their original filename in 8 character directories, based on the content and property GUID identifier)
110140
- `/cache` - contains the ImageSharp image cache, stored as files with a filename defined by the `ICacheHash` registered in ImageSharp (the default `CacheHash` generates SHA256 hashes of the file contents and uses the first characters configured by the `Umbraco:CMS:Imaging:CacheHashLength` setting)
111141

112-
Note that this is different than the behavior of other file system providers - i.e. https://github.com/umbraco-community/UmbracoFileSystemProviders.Azure that expect the media contents to be at the root level.
142+
> **Note**
143+
> This is different than the behavior of other file system providers, i.e. [UmbracoFileSystemProviders.Azure](https://github.com/umbraco-community/UmbracoFileSystemProviders.Azure) that expect the media contents to be at the root level.
113144
114145
## Using the file system providers
115146
Please refer to our documentation on [using custom file systems](https://our.umbraco.com/documentation/Extending/FileSystemProviders/).

0 commit comments

Comments
 (0)