| | | 1 | | using CShells.Features; |
| | | 2 | | using Elsa.Http.Handlers; |
| | | 3 | | using Elsa.Http.Services; |
| | | 4 | | using Elsa.Workflows.Management.ShellFeatures; |
| | | 5 | | using Elsa.Platform.PackageManifest.Generator.Hints; |
| | | 6 | | using JetBrains.Annotations; |
| | | 7 | | using Microsoft.Extensions.DependencyInjection; |
| | | 8 | | |
| | | 9 | | namespace Elsa.Http.ShellFeatures; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Installs services related to HTTP caching. |
| | | 13 | | /// </summary> |
| | | 14 | | [ManifestFeatureCategory("HTTP")] |
| | | 15 | | [ManifestFeatureCategory("Caching")] |
| | | 16 | | [ShellFeature( |
| | | 17 | | DisplayName = "HTTP Cache", |
| | | 18 | | Description = "Provides HTTP workflow caching for improved performance", |
| | | 19 | | DependsOn = [typeof(HttpFeature), typeof(CachingWorkflowDefinitionsFeature)])] |
| | | 20 | | [UsedImplicitly] |
| | | 21 | | public class HttpCacheFeature : IShellFeature |
| | | 22 | | { |
| | | 23 | | public void ConfigureServices(IServiceCollection services) |
| | | 24 | | { |
| | 0 | 25 | | services |
| | 0 | 26 | | .AddSingleton<IHttpWorkflowsCacheManager, HttpWorkflowsCacheManager>() |
| | 0 | 27 | | .Decorate<IHttpWorkflowLookupService, CachingHttpWorkflowLookupService>() |
| | 0 | 28 | | .AddNotificationHandler<InvalidateHttpWorkflowsCache>(); |
| | 0 | 29 | | } |
| | | 30 | | } |
| | | 31 | | |
| | | 32 | | |