缓存文件实现Sendfile

This commit is contained in:
刘祥超
2022-04-04 19:46:12 +08:00
parent 9deea64097
commit b5007b9195
8 changed files with 79 additions and 13 deletions

View File

@@ -32,6 +32,7 @@ func (this *CreatePopupAction) RunPost(params struct {
FileDir string
FileMemoryCapacityJSON []byte
FileOpenFileCacheMax int
FileEnableSendfile bool
CapacityJSON []byte
MaxSizeJSON []byte
@@ -77,7 +78,8 @@ func (this *CreatePopupAction) RunPost(params struct {
MemoryPolicy: &serverconfigs.HTTPCachePolicy{
Capacity: memoryCapacity,
},
OpenFileCache: openFileCacheConfig,
OpenFileCache: openFileCacheConfig,
EnableSendfile: params.FileEnableSendfile,
}
case serverconfigs.CachePolicyStorageMemory:
options = &serverconfigs.HTTPMemoryCacheStorage{}