Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add Cache Purge Support

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

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
  • 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

Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fastly/compute-sdk-python

All issues in fastly/compute-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.