docs: rewrite custom-cache example to demonstrate offline-fallback semantics (KSM-920) - #67
Merged
stas-schaller merged 1 commit intoApr 30, 2026
Conversation
…mantics (KSM-920)
The previous example claimed the second GetSecrets call within the TTL
window was "served from cache, no API request." The Go SDK does not
implement pre-call cache lookups — ICache is an offline resilience
mechanism, not a request-rate limiter.
Rewrite main.go to demonstrate what the cache actually does (enabled by
KSM-921 now also landing on this branch):
- Call 1: normal API request populates the cache
- Call 2: unreachable hostname (NXDOMAIN) triggers KSM-921 fallback,
cached records returned, warning logged
- Call 3: Purge() + unreachable host → original network error surfaces
Package docstring, inline comments, README Custom Cache section, and
CHANGELOG Documentation entry updated to describe offline-fallback
semantics rather than TTL hit/miss semantics.
Closes KSM-920
stas-schaller
merged commit Apr 30, 2026
a7c4058
into
release/sdk/golang/core/v1.7.0
2 checks passed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The previous
example/custom-cache/main.goclaimed the secondGetSecretscall within the TTL window was "served from cache, no API request." The Go SDK does not implement pre-call cache lookups —ICacheis an offline resilience mechanism. EveryGetSecretscall contacts the API; the cache is only consulted when the API returns non-200 or the request fails at the network layer.This PR rewrites the example to demonstrate what the cache actually does now that KSM-921 is on the release branch:
SaveCachedValuecalled → cache populatedkeepersecurity.invalid(NXDOMAIN) → KSM-921 fallback fires → cached records returned, warning loggedcache.Purge()+ same broken host → no cached data → original network error surfacesThe package docstring, inline comments, README Custom Cache section, and CHANGELOG Documentation entry are all updated to describe offline-fallback semantics accurately.
Related Issues
Closes KSM-920
Part of v1.7.0 release (PR #51)