Add Cache Purge Support
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start with stubs/wit_world/imports/purge.py and the Fastly Cache Purging documentation. Define the function-based purge API and PurgeOptions behavior described in the issue, including validation and verbose response parsing, then add wrapper tests for those cases and xfail coverage for functionality requiring actual purge execution.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 5
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fastly/compute-sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fastly/compute-sdk-python#116 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fastly/compute-sdk-python#98 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fastly/compute-sdk-python#74 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
fastly/compute-sdk-python#61 ·
-
fastly/compute-sdk-python#60 · 1 assignee ·
All issues in fastly/compute-sdk-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·