Repository navigation
feat(app): pluggable HTTP cache policy for the metadata endpoints (ETag included, off by default) - #249
Merged
Conversation
…ag included and off by default MetadataHttpCachePolicy lets the application decide how clients cache descriptors, entity metadata and navigation served by /apps/api/metadata. No policy by default (responses unchanged). dynamia.app.metadata.http-cache=etag enables ContentEtagMetadataHttpCachePolicy: strong ETag from content and locale, Cache-Control private,no-cache, Vary Accept-Language, and 304 on a matching If-None-Match. An application bean replaces it. Actions, entity data and executions are never cached. Refs #248 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GDh8QvbJA9soPiZXVjuYph
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.
Part 1 of #248 (HTTP cache policy). Part 2 (server-side Spring
Cache) is deliberately not included: the descriptors are already cached byAbstractViewDescriptorFactory, so it only makes sense if measuring shows serialization matters.MetadataHttpCachePolicy(+MetadataCacheDirectives): the application decides ETag /Cache-Control/Varyfor/apps/api/metadatadescriptors, entities and navigation. Nothing by default: responses are unchanged.dynamia.app.metadata.http-cache=etagenablesContentEtagMetadataHttpCachePolicy: strong ETag from content + locale,Cache-Control: private, no-cache,Vary: Accept-Language,304with no body on a matchingIf-None-Match.MetadataHttpCachePolicybean of the application replaces the included one.ResponseBodyAdvicescoped toApplicationMetadataControllerand an allowlist of read-only paths; actions,/entities/ref/**, executions, dashboard and reports are never cached.docs/backend/ARCHITECTURE.md.Tests:
MetadataHttpCacheAdviceTest(8: default untouched, ETag, 304, changed content, locale in the validator, path allowlist and POST, custom policy, policy returning nothing) and the existingApplicationMetadataControllerTest(19), viamvn -pl platform/app -am test. Mutation-checked (304 and locale). Not run: the rest of the reactor, and a real request against a running server.🤖 Generated with Claude Code
https://claude.ai/code/session_01GDh8QvbJA9soPiZXVjuYph