You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-7Lines changed: 38 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,10 @@
1
1
# Umbraco storage providers
2
2
This repository contains Umbraco storage providers that can replace the default physical file storage.
3
3
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:
> **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.
52
56
53
57
### 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.
55
59
56
60
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`.
57
61
@@ -67,7 +71,7 @@ public void ConfigureServices(IServiceCollection services)
> **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.
106
111
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
108
138
The container name is expected to exist and uses the following folder structure:
109
139
-`/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)
110
140
-`/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)
111
141
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.
113
144
114
145
## Using the file system providers
115
146
Please refer to our documentation on [using custom file systems](https://our.umbraco.com/documentation/Extending/FileSystemProviders/).
0 commit comments