weixin_39690958
2020-11-30 00:09Add disk based cache system
I added the package "cache/file" that support a disk based cache system. With low memory environment the disk based cache system is useful.
Usage (part of examples/cache):
var flagFile = "/tmp"
// part of examples/cache/cache.go
func newServerFile(srv imageserver.Server) imageserver.Server {
if flagFile == "" {
return srv
}
cch := imageserver_cache_file.Cache{flagFile }
kg := imageserver_cache.NewParamsHashKeyGenerator(sha256.New)
return &imageserver_cache.Server{
Server: srv,
Cache: &cch,
KeyGenerator: kg,
}
}
该提问来源于开源项目:pierrre/imageserver
- 点赞
- 回答
- 收藏
- 复制链接分享
5条回答
为你推荐
- 在此服务器上找不到请求的URL / be,但存在路由 - Laravel
- apache
- laravel
- nginx
- php
- 3个回答
- 错误消息“禁止您在另一台PC上没有访问/在此服务器上的权限”
- apache
- wampserver
- httpd.conf
- php
- 1个回答
- phpstudy无法目录显示怎么解决
- apache
- php
- 1个回答