From f1479055325de8de7a9c7550e8082ad859270770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 24 Feb 2022 20:12:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=86=99=E5=85=A5=E5=8E=8B=E7=BC=A9=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../servers/components/cache/createPopup.go | 24 +++++++++-------- .../servers/components/cache/update.go | 26 ++++++++++--------- .../servers/components/cache/createPopup.html | 7 +++++ .../servers/components/cache/policy.html | 7 +++++ .../servers/components/cache/update.html | 7 +++++ 5 files changed, 48 insertions(+), 23 deletions(-) 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负载过高。

+ + 描述