添加查询缓存

有一些效果,原来10分钟就会崩溃的,现在延长了一个小时,不过有的时候,还是会崩溃
This commit is contained in:
2025-12-29 15:03:58 +08:00
parent 1ec13289dc
commit f9fe3a36e6
11 changed files with 550 additions and 280 deletions

View File

@@ -786,6 +786,9 @@ namespace WebSite
Exception ex = Server.GetLastError();
logger.Error("IIS:" + ex.Message);
logger.Error(ex.StackTrace);
// 清理可能导致循环异常的资源
HttpContext.Current.ClearError();
}
catch (Exception ex)
{
@@ -802,9 +805,9 @@ namespace WebSite
var ip = Request.UserHostAddress;
var url = Request.Url.AbsolutePath.ToLower();
// 定期清理恶意IP记录避免字典无限增长
var nowUtc = DateTime.UtcNow;
CleanupIpRecordIfNeeded(nowUtc);
// 定期清理恶意IP记录避免字典无限增长
var nowUtc = DateTime.UtcNow;
CleanupIpRecordIfNeeded(nowUtc);
// 定义要拦截的路径模式
var maliciousPatterns = new[]