Repository navigation
feat(payload-caching): add opt-in payload caching - #2191
Open
cconstable wants to merge 1 commit into
Open
cconstable wants to merge 1 commit into
cconstable wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cconstable
marked this pull request as ready for review
December 2, 2026 23:11
This branch has not been deployed
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.
What changed
PayloadCachebase class andInMemoryPayloadCache, which evicts the least recently used payload first.Client.connectandClienttake a newpayload_cacheargument.None, the default, means no cache. Workers use their client's cache.Why
External Storage payloads can be downloaded many times: when a Worker processes tasks, when a Client reads results, and during replay. A cache avoids repeated storage calls. The cache is a general payload cache, and External Storage is currently its only user, so future payload features can reuse it.
This ports the payload cache from the TypeScript SDK (temporalio/sdk-typescript#2478).
How it works
payload_cache_lookup_hit,payload_cache_lookup_hit_bytesandpayload_cache_rejection(taggedreason=declinedorreason=error). Clients tag them with the namespace. Workers also add the task queue.Checks
poe lintsteps: all passed.pytestsuite against a local dev server: no new failures.test_search_attributesfails onmaintoo, because the local server lacks a search attribute.