实现open file cache

This commit is contained in:
刘祥超
2022-01-12 21:09:11 +08:00
parent 7362722adb
commit 5b7eaf08ae
6 changed files with 46 additions and 5 deletions

View File

@@ -26,7 +26,7 @@
</td>
</tr>
<tr>
<td class="color-border">文件目录最大容量</td>
<td class="color-border">文件目录最大容量 *</td>
<td>
<size-capacity-box :v-name="'capacityJSON'" :v-count="128" :v-unit="'gb'" :key="'capacityJSON1'"></size-capacity-box>
<p class="comment">作为二级缓存的文件目录允许缓存的最大容量如果为0表示没有限制。</p>
@@ -38,6 +38,13 @@
<size-capacity-box :v-name="'fileMemoryCapacityJSON'" :v-count="0" :v-unit="'gb'" :key="'fileMemoryCapacityJSON'"></size-capacity-box>
<p class="comment">作为一级缓存的内存最大容量如果为0表示不使用内存作为一级缓存。</p>
</td>
</tr>
<tr>
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment">保持缓存文件句柄提升缓存文件打开速度建议数量是缓存文件数量的10%。</p>
</td>
</tr>
</tbody>

View File

@@ -40,6 +40,10 @@
<p class="comment">作为一级缓存的内存最大容量如果为0表示不使用内存作为一级缓存。</p>
</td>
</tr>
<tr v-if="cachePolicy.options.openFileCache != null && cachePolicy.options.openFileCache.isOn && cachePolicy.options.openFileCache.max > 0">
<td>缓存文件句柄缓存</td>
<td>{{cachePolicy.options.openFileCache.max}}</td>
</tr>
</tbody>
<tbody v-if="cachePolicy.type != 'file'">

View File

@@ -47,6 +47,13 @@
<size-capacity-box :v-name="'fileMemoryCapacityJSON'" :v-count="0" :v-unit="'gb'"></size-capacity-box>
<p class="comment">作为一级缓存的内存最大容量如果为0表示不使用内存作为一级缓存。</p>
</td>
</tr>
<tr>
<td class="color-border">缓存文件句柄缓存</td>
<td>
<input type="text" name="fileOpenFileCacheMax" v-model="fileOpenFileCacheMax" maxlength="6" value="0" style="width: 10em"/>
<p class="comment">保持缓存文件句柄提升缓存文件打开速度建议数量是缓存文件数量的10%。</p>
</td>
</tr>
</tbody>

View File

@@ -2,4 +2,9 @@ Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功 ")
this.policyType = this.cachePolicy.type
this.fileOpenFileCacheMax = 0
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
}
})