Context
The GET /api/v1/skills/{ns}/{name}/versions/{ver}/content endpoint (PR #11) creates a brand-new OCI client and temp store directory for every request. It pulls the full layer blob, extracts SKILL.md, serves it, then cleans up.
Problem
This is extremely inefficient for repeated requests to the same skill version. Each request:
- Creates a new OCI layout store in a temp directory
- Pulls the entire layer from the registry
- Decompresses gzip + extracts tar to find SKILL.md
- Deletes everything on response
Proposed solution
Options (in order of complexity):
-
In-memory LRU cache — cache extracted SKILL.md content keyed by (repository, tag, digest). Invalidate on digest change during sync. Simplest, covers the 90% case.
-
Shared OCI client — reuse a single client instance across requests so pulled layers are cached in the local OCI store. Add periodic cleanup of old layers.
-
Streaming tar extraction — instead of unpacking to disk, stream through the gzip+tar to extract only SKILL.md without writing temp files.
Current state
Documented as a known limitation in PR #11. Acceptable for Phase 2a since content requests are infrequent (individual skill detail pages), but should be optimized before production use.
Context
The
GET /api/v1/skills/{ns}/{name}/versions/{ver}/contentendpoint (PR #11) creates a brand-new OCI client and temp store directory for every request. It pulls the full layer blob, extracts SKILL.md, serves it, then cleans up.Problem
This is extremely inefficient for repeated requests to the same skill version. Each request:
Proposed solution
Options (in order of complexity):
In-memory LRU cache — cache extracted SKILL.md content keyed by
(repository, tag, digest). Invalidate on digest change during sync. Simplest, covers the 90% case.Shared OCI client — reuse a single client instance across requests so pulled layers are cached in the local OCI store. Add periodic cleanup of old layers.
Streaming tar extraction — instead of unpacking to disk, stream through the gzip+tar to extract only SKILL.md without writing temp files.
Current state
Documented as a known limitation in PR #11. Acceptable for Phase 2a since content requests are infrequent (individual skill detail pages), but should be optimized before production use.