Define global allowQuery / varies in nitro config
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 40/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend, performance
调研方向
The feature touches the cache configuration in nitro.config.ts and the cachedHandler options, so start with how cache.defaults is read and merged with per-handler allowQuery and varies. The docs at https://nitro.build/docs/cache#global-options are the reference for current behaviour. Done means a global default can be set and a handler's cache key includes it, with the merge rule documented.
由索引模型根据 Issue 内容生成。
描述
Describe the feature
It would be nice if query params can be set in nitro.config.ts, so these query params always vary the cache key and reach every handler.
E.g. if every route takes a locale query param ?locale=fr, locale could be added globally so one does not have to add it to every cachedHandler (and possibly forgets it).
The same example when using Accept-Language header instead of query param: accept-language could be added to global varies, so one does not have to add it to every cachedHandler (and possibly forgets it).
Additional information
Apparently nitro config already allows for cache.defaults to be set but the docs don't say whether cachedHandlers allowQuery replaces or merges with the default: https://nitro.build/docs/cache#global-options
- 主要语言
- TypeScript
- 星标
- 11.5k
- 派生
- 968
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 64
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nitrojs/nitro 的其他 Issue
-
pending triage
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 95/100
维护者通常 2 天内回复
-
cloudflare: `nitro deploy` fails when a parent directory has a Wrangler config可能已有人在做 @draarivpatel-ui 于 13 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 2 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
pending triage
难度 5/5 一周以上 新手友好度 30/100
nitrojs/nitro#5205 · 1 个 reaction ·
维护者通常 2 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
ranxianglei/billion-context#8319 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
JimLiu/open-artifact#126 ·
-
bug repro-ready
难度 2/5 1-3 小时 新手友好度 86/100
mksglu/context-mode#1454 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
laststance/design-world#98 ·
维护者通常 1 天内回复
-
approved check:passed streams:add
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复