Skip to content

Commit 62ab666

Browse files
committed
Moving settings to settings namespace and adding to readme
1 parent 23ab4e8 commit 62ab666

12 files changed

+54
-42
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To configure add the following section to the root of your appsettings.json file
3131
You'll need to configure these settings based on the values in Azure:
3232

3333
| Setting | Description |
34-
| ----------------- | ----------------------------------------------------- |
34+
| ----------------- | --------------------------------------------------------------------- |
3535
| SubscriptionId | The ID of the Azure subscription that the Front Door belongs to |
3636
| ResourceGroupName | The name for the Azure resource group that the Front Door belongs to |
3737
| FrontDoorName | The name of the Front Door to purge |
@@ -43,14 +43,15 @@ You'll need to configure these settings based on the values in Azure:
4343

4444
You can also customise the configuration by setting these settings:
4545

46-
| Setting | Description |
47-
| ------------------------------------- | -------------------------------------------------------------------------------------------- |
48-
| Enabled | |
49-
| Mode | |
50-
51-
52-
53-
54-
46+
| Setting | Description |
47+
| ----------------- | ------------------------------------------------------ |
48+
| Enabled | Set to true to enable the module, or falst to disable |
49+
| Mode | Can be one of: All, Self or SelfAndAncestors |
5550

51+
# Modes
5652

53+
| Name | Description |
54+
| ---------------- | ---------------------------------------------------------------------------------------------------------- |
55+
| All | Will completely purge the cache when either media or content is published |
56+
| Self | Will purge just the media or content that is published |
57+
| SelfAndAncestors | Will purge the published media and for content will purge all of its ancestors working up the content tree |

src/Umbraco.Community.FrontDoorCache.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ VisualStudioVersion = 17.9.34607.119
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Community.FrontDoorCache", "Umbraco.Community.FrontDoorCache\Umbraco.Community.FrontDoorCache.csproj", "{B3C79565-F838-4D8A-B6D1-8C95B042023B}"
77
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A81AC8D6-7E2D-40A0-AABB-DCF4111EF136}"
9+
ProjectSection(SolutionItems) = preProject
10+
..\README.md = ..\README.md
11+
..\EntraIdSetup.md = ..\EntraIdSetup.md
12+
EndProjectSection
13+
EndProject
814
Global
915
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1016
Debug|Any CPU = Debug|Any CPU

src/Umbraco.Community.FrontDoorCache/Api/FrontDoorApiClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
using Azure.ResourceManager.Cdn.Models;
66
using Microsoft.Extensions.Logging;
77
using Microsoft.Extensions.Options;
8+
using Umbraco.Community.FrontDoorCache.Settings;
89

910
namespace Umbraco.Community.FrontDoorCache.Api
1011
{
11-
public class FrontDoorApiClient : IFrontDoorApiClient
12+
public class FrontDoorApiClient : IFrontDoorApiClient
1213
{
1314
private ILogger<FrontDoorApiClient> _logger;
1415
private FrontDoorCacheOptions _options;

src/Umbraco.Community.FrontDoorCache/ContentSavedNotificationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
using Umbraco.Cms.Core.Routing;
99
using Umbraco.Cms.Core.Web;
1010
using Umbraco.Community.FrontDoorCache.Api;
11+
using Umbraco.Community.FrontDoorCache.Settings;
1112
using Umbraco.Extensions;
1213

1314
namespace Umbraco.Community.FrontDoorCache
1415
{
15-
public class ContentSavedNotificationHandler
16+
public class ContentSavedNotificationHandler
1617
: INotificationAsyncHandler<ContentSavedNotification>
1718
{
1819
private readonly ILogger _logger;

src/Umbraco.Community.FrontDoorCache/FrontDoorCacheOptions.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/Umbraco.Community.FrontDoorCache/HealthChecks/FrontDoorCacheHealthCheck.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using Microsoft.Extensions.Options;
22
using Umbraco.Cms.Core.HealthChecks;
33
using Umbraco.Community.FrontDoorCache.Api;
4+
using Umbraco.Community.FrontDoorCache.Settings;
45

56
namespace Umbraco.Community.FrontDoorCache.HealthChecks
67
{
7-
[HealthCheck(HealthCheckId, HealthCheckName, Description = "Checks the Azure Front Door API to ensure it is available.", Group = "CDN")]
8+
[HealthCheck(HealthCheckId, HealthCheckName, Description = "Checks the Azure Front Door API to ensure it is available.", Group = "CDN")]
89
public class FrontDoorCacheHealthCheck : HealthCheck
910
{
1011
private const string HealthCheckId = "3f0bbea9-d82e-4805-b9c0-aae4c8bf96eb";

src/Umbraco.Community.FrontDoorCache/MediaSavedNotificationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
using Umbraco.Cms.Core.Routing;
99
using Umbraco.Cms.Core.Web;
1010
using Umbraco.Community.FrontDoorCache.Api;
11+
using Umbraco.Community.FrontDoorCache.Settings;
1112
using Umbraco.Extensions;
1213

1314
namespace Umbraco.Community.FrontDoorCache
1415
{
15-
public class MediaSavedNotificationHandler
16+
public class MediaSavedNotificationHandler
1617
: INotificationAsyncHandler<MediaSavedNotification>
1718
{
1819
private readonly ILogger _logger;

src/Umbraco.Community.FrontDoorCache/PurgeCacheMode.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Umbraco.Community.FrontDoorCache.Settings
2+
{
3+
public class FrontDoorCacheOptions
4+
{
5+
public bool Enabled { get; set; }
6+
public PurgeCacheMode Mode { get; set; }
7+
public string SubscriptionId { get; set; }
8+
public string ResourceGroupName { get; set; }
9+
public string FrontDoorName { get; set; }
10+
public string EndpointName { get; set; }
11+
public string TenantId { get; set; }
12+
public string ClientId { get; set; }
13+
public string ClientSecret { get; set; }
14+
public string[] Domains { get; set; }
15+
}
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace Umbraco.Community.FrontDoorCache.Settings
2+
{
3+
public enum PurgeCacheMode
4+
{
5+
Unknown = 0,
6+
All = 1,
7+
Self = 2,
8+
SelfAndAncestors = 3
9+
}
10+
}

0 commit comments

Comments
 (0)