支持Range/If-Range读取静态资源片段

This commit is contained in:
GoEdgeLab
2021-01-10 22:35:34 +08:00
parent e5a634c5ac
commit 687a6a5c8f
4 changed files with 323 additions and 14 deletions

View File

@@ -307,6 +307,11 @@ func (this *HTTPWriter) prepareCache(size int64) {
return
}
// 不支持Range
if len(this.Header().Get("Content-Range")) > 0 {
return
}
cachePolicy := sharedNodeConfig.HTTPCachePolicy
if cachePolicy == nil || !cachePolicy.IsOn {
return