Add Cache Purge Support
还没有人认领这个 Issue。
评估
调研方向
从 stubs/wit_world/imports/purge.py 和 Fastly Cache Purging 文档开始。定义 issue 中描述的基于函数的 purge API 以及 PurgeOptions 的行为,包括验证和详细的响应解析,然后为这些情况添加 wrapper 测试,并为需要实际执行 purge 的功能添加 xfail 覆盖。
由索引模型根据 Issue 内容生成。
描述
Overview
Add support for Fastly's Cache Purge API, enabling surrogate key-based cache invalidation.
WIT Interface
interface purge {
use types.{error};
resource extra-purge-options;
record purge-options {
soft-purge: bool,
extra: option<borrow<extra-purge-options>>,
}
purge-surrogate-key: func(surrogate-keys: string, purge-options: purge-options) -> result<_, error>;
purge-surrogate-key-verbose: func(surrogate-keys: string, purge-options: purge-options, max-len: u64) -> result<string, error>;
}
WIT bindings: stubs/wit_world/imports/purge.py
API Design
- Simple function-based API:
purge_surrogate_key(keys, soft=False) - Optional verbose version:
purge_surrogate_key_verbose(keys, soft=False)returns purge ID PurgeOptionsdataclass withsoft_purgeboolean flag- Support single or space-separated multiple surrogate keys (max 1024 chars per key)
- Return purge ID (JSON response) for verbose variant
Cross-SDK Comparison: All SDKs expose simple function-based API: purge_surrogate_key(key). Straightforward across all languages with similar semantics.
Viceroy Testing
Cache purge operations in Viceroy are likely stubbed or no-op. Tests should focus on:
- API wrapper behavior (parameter validation, error handling)
- Response parsing for verbose variant
- Use
xfailmarkers for functionality requiring actual purge execution
The purge API primarily validates input and returns success without actually purging in local testing.
Reference
- 主要语言
- Python
- 星标
- 5
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fastly/compute-sdk-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
fastly/compute-sdk-python#116 ·
-
难度 4/5 3-5 天 新手友好度 35/100
fastly/compute-sdk-python#98 ·
-
难度 5/5 一周以上 新手友好度 35/100
fastly/compute-sdk-python#74 ·
-
难度 5/5 一周以上 新手友好度 35/100
fastly/compute-sdk-python#61 ·
-
Set up Sphinx Documentation Infrastructure可能重新可做 @erikrose 于 172 天前认领,目前没有进行中的 PR。 未关闭
fastly/compute-sdk-python#60 · 已指派 1 人 ·
查看 fastly/compute-sdk-python 的全部 Issue
相似的 Issue
-
docs pydanty:is-working
难度 2/5 1-3 小时 新手友好度 75/100
pydantic/pydantic-ai#8863 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
run-llama/llama_index#23278 ·
维护者通常 2 天内回复
-
documentation from-review-extraction github-actions priority: low severity:nit
难度 1/5 1 小时以内 新手友好度 92/100
LearningCircuit/local-deep-research#6946 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
oracle/langchain-oracle#323 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
tenstorrent/tt-metal#58057 · 1 条评论 ·
维护者通常 1 天内回复