Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add Cache Purge Support

Đang mở
#55 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api

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
  • PurgeOptions dataclass with soft_purge boolean 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 xfail markers 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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fastly/compute-sdk-python

Tất cả issue của fastly/compute-sdk-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.