Release 1.5.0: Cache Support for Compound Documents #108
MoonWorm
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
This release adds built-in caching to the Compound Documents Resolver, reducing redundant downstream HTTP calls and improving response times for repeated
includequeries.How It Works
The resolver now caches individual resources by their
type,id, requestedincludes, and sparsefields. When a compound document request arrives, the resolver checks the cache first and only fetches cache misses via HTTP - cached and freshly fetched resources are merged transparently.Cache behavior is driven by standard HTTP
Cache-Controlheaders from downstream responses:max-age/s-maxagedetermines entry TTLno-store,no-cache,privateprevent caching entirelyThe final compound document response carries an aggregated
Cache-Controlheader - the most restrictive directive across all included resources. For example, ifcountriesreturnsmax-age=300andcurrenciesreturnsmax-age=60, the compound document response will containmax-age=60.Configuration
Cache is enabled by default. To customize:
Custom Cache Implementations
The built-in cache uses an in-memory
ConcurrentHashMapwith lazy TTL expiration and LRU eviction. For distributed deployments or custom eviction policies, implement theCompoundDocsResourceCacheSPI and register your own bean - the framework will use it instead of the default.Resources
Beta Was this translation helpful? Give feedback.
All reactions