缓存条件增加If-None-Match和If-Modified-Since是否回源选项;默认不回源,防止源站返回304

This commit is contained in:
GoEdgeLab
2022-08-07 16:37:29 +08:00
parent 2bc7de1438
commit d4a8ce48a5
2 changed files with 10 additions and 2 deletions

View File

@@ -70,6 +70,14 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId
// 强制变更原来访问的域名
requestHost = this.ReqHost
}
// 回源Header中去除If-None-Match和If-Modified-Since
if !this.cacheRef.EnableIfNoneMatch {
this.DeleteHeader("If-None-Match")
}
if !this.cacheRef.EnableIfModifiedSince {
this.DeleteHeader("If-Modified-Since")
}
}
// 自定义源站