-
Notifications
You must be signed in to change notification settings - Fork 35
Open
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
Metadata
Metadata
Assignees
Labels
No labels