优化代码

This commit is contained in:
GoEdgeLab
2022-01-01 20:15:39 +08:00
parent 6606fa049d
commit be412f5740
16 changed files with 97 additions and 86 deletions

View File

@@ -22,7 +22,7 @@ import (
func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) {
this.cacheCanTryStale = false
cachePolicy := this.Server.HTTPCachePolicy
cachePolicy := this.ReqServer.HTTPCachePolicy
if cachePolicy == nil || !cachePolicy.IsOn {
return
}
@@ -138,7 +138,7 @@ func (this *HTTPRequest) doCacheRead(useStale bool) (shouldStop bool) {
if err == nil {
for _, rpcServerService := range rpcClient.ServerRPCList() {
_, err = rpcServerService.PurgeServerCache(rpcClient.Context(), &pb.PurgeServerCacheRequest{
Domains: []string{this.host},
Domains: []string{this.ReqHost},
Keys: []string{key},
Prefixes: nil,
})