[API Policies] Semantic Cache Policy Issue
@Thenujan-Nagaratnam is already working on this.
Since Jan 15, 2026.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Overview
Cache isolation bug prevents cache hits when API identity information is missing, completely defeating the caching mechanism.
Issue Details
Fallback to RequestID Causes Cache Isolation Per Request
File: semanticcache.go (lines 429-434)
Description:
When apiID is ":" (indicating missing API name/version), the code falls back to using ctx.RequestID as the cache key. Since RequestID is unique per request, this prevents any cache sharing across requests - each response gets cached under a different key and can never be retrieved.
Code Flow:
apiID := fmt.Sprintf("%s:%s", ctx.APIName, ctx.APIVersion)
if apiID == ":" {
apiID = ctx.RequestID // PROBLEM: Unique per request!
}
Proposed Fix:
Use a meaningful fallback for apiID instead of RequestID, such as a default value or log a warning about missing apiID.
Impact:
Cache hits will never occur when apiID is ":", completely defeating the purpose of semantic caching.
Reference
Contributor guide
No contributing guide indexed for this repository
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.
Assessment
This issue has not been assessed yet.