Add Cache Purge Support
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu với stubs/wit_world/imports/purge.py và tài liệu Fastly Cache Purging. Định nghĩa purge API dựa trên hàm và hành vi của PurgeOptions được mô tả trong issue, bao gồm việc xác thực và phân tích chi tiết phản hồi, sau đó thêm các bài kiểm thử wrapper cho những trường hợp đó cùng với độ bao phủ xfail cho các chức năng yêu cầu thực thi purge thực tế.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 5
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fastly/compute-sdk-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fastly/compute-sdk-python#116 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
fastly/compute-sdk-python#98 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fastly/compute-sdk-python#74 ·
-
Add HTTP Downstream Metadata API Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fastly/compute-sdk-python#61 ·
-
fastly/compute-sdk-python#60 · 1 người được giao ·
Tất cả issue của fastly/compute-sdk-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
modelscope/FunASR#3728 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
open-compass/opencompass#2655 ·