如果有新记录就暂不缓存本次搜索结果
This commit is contained in:
parent
64a1f686c3
commit
2e5abe50ea
|
|
@ -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<IHttpContextAccessor>();
|
||||
if (httpContext.HttpContext.Response.Headers["Cache-Control"].ToString().Contains("no-store"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var cache = Services.GetRequiredService<ICacheService>();
|
||||
|
||||
if (context.ReturnValue != null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue