How do I limit the size of the cache?
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- go, nginx
- 领域
- backend, performance
调研方向
从所引用的 examples/nginx.conf 和缓存插件文档开始,目前文档描述的是基于过期时间的缓存。调查缓存实现是否提供响应总大小限制或 LRU 淘汰,并确定相关的配置和测试。完成的标准是:记录受支持的行为,或明确规定缺失的基于大小的 LRU 策略。
由索引模型根据 Issue 内容生成。
描述
I'm trying to translate this nginx config to Caddy:
https://github.com/grishka/Smithereen/blob/4dcad9dd968b2ae6be04281d6a9ca72d13d4cfc8/examples/nginx.conf
This works but doesn't do so optimally because it would hit imgproxy every time a client requests a resized image:
smithereen.local
encode
# Static files
handle /s/* {
root /var/www/smithereen
file_server
}
# imgproxy
handle /i/* {
reverse_proxy 127.0.0.1:4560
}
# Server application itself
handle {
reverse_proxy 127.0.0.1:4567
}
So I started looking into replicating my nginx setup, where I cache the images processed by imgproxy, and this plugin seems to be the way to do cache on Caddy. Except I couldn't find a way to limit the cache by the combined size of all cached responses instead of the time, so least-recently used responses would get deleted to make room for new ones. Ideally I would just not have any expiration component whatsoever to my caching strategy, but nginx can't do that so I set the TTL to 10 years.
Does this plugin not support this sort of LRU strategy, or did I overlook it? The docs all only talk about the expiration time.
- 主要语言
- Go
- 星标
- 393
- 派生
- 30
- 平均合并
- 32 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
caddyserver/cache-handler 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
caddyserver/cache-handler#138 · 1 条评论 · 3 个 reaction ·
-
难度 3/5 半天 新手友好度 45/100
caddyserver/cache-handler#146 ·
-
难度 4/5 3-5 天 新手友好度 48/100
caddyserver/cache-handler#145 ·
-
难度 3/5 1-2 天 新手友好度 76/100
caddyserver/cache-handler#143 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 55/100
caddyserver/cache-handler#140 · 4 条评论 · 1 个 reaction ·
查看 caddyserver/cache-handler 的全部 Issue
相似的 Issue
-
agent-butler-finding chore
难度 1/5 1 小时以内 新手友好度 90/100
jordansmall/spindrift#5575 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
JakeChampion/lang#12684 ·
维护者通常 1 天内回复
-
goose sub-agent runs are never indexed: blame finds no session for any file a `delegate` child wrote未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
C-bug O-community X-blathers-triaged
难度 2/5 1-3 小时 新手友好度 78/100
cockroachdb/cockroach#176150 · 1 条评论 ·
维护者通常 12 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 86/100
wakatime/wakatime-cli#1649 ·
维护者通常 1 天内回复