Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ Get sdk versions
curl https://version-vault.cdn.dog/python/pyenv
```

### uv-build versions

Fetch the Python builds list provided by [`astral-sh/uv`](https://github.com/astral-sh/uv) (sourced from `crates/uv-python/download-metadata.json` of the latest release).

```sh
curl https://version-vault.cdn.dog/python/uv-build
```

You can narrow down the result by passing query parameters. Filtering happens server-side, so the response is smaller and faster to consume.

| Query | Description | Example values |
| ----- | ----------- | -------------- |
| `os` | Operating system / platform | `darwin`, `linux`, `windows` |
| `arch` | CPU architecture family | `x86_64`, `aarch64`, `armv7` |
| `libc` | C library type | `none`, `gnu`, `musl` |

Examples:

```sh
# Linux + aarch64 + glibc builds only
curl "https://version-vault.cdn.dog/python/uv-build?os=linux&arch=aarch64&libc=gnu"

# All macOS builds
curl "https://version-vault.cdn.dog/python/uv-build?os=darwin"
```

Pass `force=1` to bypass the cache for this endpoint.

## Development

Install dependencies:
Expand Down
10 changes: 8 additions & 2 deletions src/utils/cache-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,16 @@ export async function withCache<T>(
}

/**
* Create cache key from request, ignoring query params
* Create cache key from request.
*
* Query parameters are preserved so that filtered responses (e.g. `?os=darwin`)
* are cached separately from unfiltered ones. The `force` parameter is stripped
* because it only controls cache-bypass behavior and must not affect the key.
*/
export function createCacheKey(request: Request): Request {
const cacheUrl = new URL(request.url);
cacheUrl.search = "";
cacheUrl.searchParams.delete("force");
// Sort remaining params so equivalent queries map to the same cache entry
cacheUrl.searchParams.sort();
return new Request(cacheUrl.toString(), request);
}