diff --git a/web/views/@default/servers/components/cache/update.html b/web/views/@default/servers/components/cache/update.html
index 7084009a..6d6f4019 100644
--- a/web/views/@default/servers/components/cache/update.html
+++ b/web/views/@default/servers/components/cache/update.html
@@ -12,7 +12,7 @@
| 缓存类型 * |
- |
diff --git a/web/views/@default/servers/components/cache/update.js b/web/views/@default/servers/components/cache/update.js
index c4b6494f..8ba862cf 100644
--- a/web/views/@default/servers/components/cache/update.js
+++ b/web/views/@default/servers/components/cache/update.js
@@ -7,4 +7,20 @@ Tea.context(function () {
if (this.cachePolicy.type == "file" && this.cachePolicy.options.openFileCache != null && this.cachePolicy.options.openFileCache.isOn && this.cachePolicy.options.openFileCache.max > 0) {
this.fileOpenFileCacheMax = this.cachePolicy.options.openFileCache.max
}
+
+ this.changePolicyType = function () {
+ if (this.policyType == "file") {
+ let options = this.cachePolicy.options
+ if (options != null && typeof options == "object" && typeof options["dir"] === "undefined") {
+ options["enableMMAP"] = true
+ options["dir"] = "/opt/cache"
+ options["memoryPolicy"] = {
+ capacity: {
+ unit: "gb",
+ count: 2
+ }
+ }
+ }
+ }
+ }
})
\ No newline at end of file