diff --git a/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs b/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs index 03bc70bb..17ddb830 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Infrastructures/SharpCacheAttribute.cs @@ -1,4 +1,5 @@ using BotSharp.Abstraction.Infrastructures; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Rougamo; using Rougamo.Context; @@ -42,6 +43,12 @@ public class SharpCacheAttribute : MoAttribute return; } + var httpContext = Services.GetRequiredService(); + if (httpContext.HttpContext.Response.Headers["Cache-Control"].ToString().Contains("no-store")) + { + return; + } + var cache = Services.GetRequiredService(); if (context.ReturnValue != null)