优化代码

This commit is contained in:
刘祥超
2022-01-01 20:15:39 +08:00
parent a1212804bb
commit 336db828ad
16 changed files with 97 additions and 86 deletions

View File

@@ -441,8 +441,8 @@ func (this *HTTPWriter) Close() {
StaleAt: expiredAt + int64(this.calculateStaleLife()),
HeaderSize: this.cacheWriter.HeaderSize(),
BodySize: this.cacheWriter.BodySize(),
Host: this.req.host,
ServerId: this.req.Server.Id,
Host: this.req.ReqHost,
ServerId: this.req.ReqServer.Id,
})
}
}
@@ -566,7 +566,7 @@ func (this *HTTPWriter) prepareCache(size int64) {
return
}
cachePolicy := this.req.Server.HTTPCachePolicy
cachePolicy := this.req.ReqServer.HTTPCachePolicy
if cachePolicy == nil || !cachePolicy.IsOn {
return
}