diff --git a/internal/web/actions/default/servers/components/cache/createPopup.go b/internal/web/actions/default/servers/components/cache/createPopup.go index 07c8f23a..5e8b075e 100644 --- a/internal/web/actions/default/servers/components/cache/createPopup.go +++ b/internal/web/actions/default/servers/components/cache/createPopup.go @@ -33,9 +33,10 @@ func (this *CreatePopupAction) RunPost(params struct { FileMemoryCapacityJSON []byte FileOpenFileCacheMax int - CapacityJSON []byte - MaxSizeJSON []byte - MaxKeys int64 + CapacityJSON []byte + MaxSizeJSON []byte + MaxKeys int64 + SyncCompressionCache bool Description string IsOn bool @@ -90,14 +91,15 @@ func (this *CreatePopupAction) RunPost(params struct { return } createResp, err := this.RPC().HTTPCachePolicyRPC().CreateHTTPCachePolicy(this.AdminContext(), &pb.CreateHTTPCachePolicyRequest{ - IsOn: params.IsOn, - Name: params.Name, - Description: params.Description, - CapacityJSON: params.CapacityJSON, - MaxKeys: params.MaxKeys, - MaxSizeJSON: params.MaxSizeJSON, - Type: params.Type, - OptionsJSON: optionsJSON, + IsOn: params.IsOn, + Name: params.Name, + Description: params.Description, + CapacityJSON: params.CapacityJSON, + MaxKeys: params.MaxKeys, + MaxSizeJSON: params.MaxSizeJSON, + Type: params.Type, + OptionsJSON: optionsJSON, + SyncCompressionCache: params.SyncCompressionCache, }) if err != nil { this.ErrorPage(err) diff --git a/internal/web/actions/default/servers/components/cache/update.go b/internal/web/actions/default/servers/components/cache/update.go index 540a6ebd..3b4082b4 100644 --- a/internal/web/actions/default/servers/components/cache/update.go +++ b/internal/web/actions/default/servers/components/cache/update.go @@ -57,9 +57,10 @@ func (this *UpdateAction) RunPost(params struct { FileMemoryCapacityJSON []byte FileOpenFileCacheMax int - CapacityJSON []byte - MaxSizeJSON []byte - MaxKeys int64 + CapacityJSON []byte + MaxSizeJSON []byte + MaxKeys int64 + SyncCompressionCache bool Description string IsOn bool @@ -135,15 +136,16 @@ func (this *UpdateAction) RunPost(params struct { } _, err = this.RPC().HTTPCachePolicyRPC().UpdateHTTPCachePolicy(this.AdminContext(), &pb.UpdateHTTPCachePolicyRequest{ - HttpCachePolicyId: params.CachePolicyId, - IsOn: params.IsOn, - Name: params.Name, - Description: params.Description, - CapacityJSON: params.CapacityJSON, - MaxKeys: params.MaxKeys, - MaxSizeJSON: params.MaxSizeJSON, - Type: params.Type, - OptionsJSON: optionsJSON, + HttpCachePolicyId: params.CachePolicyId, + IsOn: params.IsOn, + Name: params.Name, + Description: params.Description, + CapacityJSON: params.CapacityJSON, + MaxKeys: params.MaxKeys, + MaxSizeJSON: params.MaxSizeJSON, + Type: params.Type, + OptionsJSON: optionsJSON, + SyncCompressionCache: params.SyncCompressionCache, }) if err != nil { this.ErrorPage(err) diff --git a/web/views/@default/servers/components/cache/createPopup.html b/web/views/@default/servers/components/cache/createPopup.html index 5c930fb3..acf4ed25 100644 --- a/web/views/@default/servers/components/cache/createPopup.html +++ b/web/views/@default/servers/components/cache/createPopup.html @@ -76,6 +76,13 @@

可以容纳多少数量的Key,0表示不限制。

+ + 同步写入压缩缓存 + + +

选中后,在压缩设置开启的情况下,在缓存源站内容的同时,也会同步写入压缩缓存;不选中,表示在源站内容缓存后,下一次调用才会缓存压缩内容,防止同一时间内硬盘IO负载过高。

+ + 描述 diff --git a/web/views/@default/servers/components/cache/policy.html b/web/views/@default/servers/components/cache/policy.html index 598db48f..128ca908 100644 --- a/web/views/@default/servers/components/cache/policy.html +++ b/web/views/@default/servers/components/cache/policy.html @@ -74,6 +74,13 @@

可以容纳多少数量的Key,0表示不限制。

+ + 同步写入压缩缓存 + + Y + N + + 描述 diff --git a/web/views/@default/servers/components/cache/update.html b/web/views/@default/servers/components/cache/update.html index 46da2c07..d1825b42 100644 --- a/web/views/@default/servers/components/cache/update.html +++ b/web/views/@default/servers/components/cache/update.html @@ -84,6 +84,13 @@

可以容纳多少数量的Key,0表示不限制。

+ + 同步写入压缩缓存 + + +

选中后,在压缩设置开启的情况下,在缓存源站内容的同时,也会同步写入压缩缓存;不选中,表示在源站内容缓存后,下一次调用才会缓存压缩内容,防止同一时间内硬盘IO负载过高。

+ + 描述