Title: Include a caching document provider implementation by default · Issue #4107 · graphql-java/graphql-java · GitHub
Open Graph Title: Include a caching document provider implementation by default · Issue #4107 · graphql-java/graphql-java
X Title: Include a caching document provider implementation by default · Issue #4107 · graphql-java/graphql-java
Description: Caching the parsing and validation of a document can save significant latency. For very large operations, and tools like Relay produce very large operations, the parse and validate latency can be upwards of 15-20ms (p99) By caching this ...
Open Graph Description: Caching the parsing and validation of a document can save significant latency. For very large operations, and tools like Relay produce very large operations, the parse and validate latency can be u...
X Description: Caching the parsing and validation of a document can save significant latency. For very large operations, and tools like Relay produce very large operations, the parse and validate latency can be u...
Opengraph URL: https://github.com/graphql-java/graphql-java/issues/4107
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Include a caching document provider implementation by default","articleBody":"Caching the parsing and validation of a document can save significant latency.\n\nFor very large operations, and tools like Relay produce very large operations, the parse and validate latency can be upwards of 15-20ms (p99)\n\nBy caching this step you can amortize the cost over many requests and hence cut nearly all of this latency out.\n\nThe `graphql.execution.preparsed.PreparsedDocumentProvider` is the interface that allows you to build a caching document mechanism but out of the box graphql-java does not provide a working implementation\n\nI propose that we \n\n* Create a `public class CachingDocumentProvider implements PreparsedDocumentProvider`\n* That is used Caffeine as the cache\n* Provide a GraphQLUnusualConfiguration mechanism to to tune the cache \n * time base\n * size based\n * etc\n* Ship with this TURN on by default (in 2 versions)\n* Shade in https://github.com/ben-manes/caffeine as the cache implementation\n\nThe implication here is that https://github.com/ben-manes/caffeine would become a dependency (shaded) and we have mostly aimed for low to zero dependencies but I think the juice is worth the squeeze here. All operations will run faster with a cache in place.\n\nI dont know right now of the implications for library frameworks such as Spring GraphQL. Do they have one themselves, is it always on? Hence this issue to stand as a discussion mechanism","author":{"url":"https://github.com/bbakerman","@type":"Person","name":"bbakerman"},"datePublished":"2025-09-02T03:12:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/4107/graphql-java/issues/4107"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2295ac3d-4630-b6fd-17fd-4580d07f1e40 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A63C:2FD50F:23B49E5:3226A29:696F6B39 |
| html-safe-nonce | daa0bb1728f41a354e7c735e5f1f93f84a455f2e52b71eab7fadff4503f3a7b1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjNDOjJGRDUwRjoyM0I0OUU1OjMyMjZBMjk6Njk2RjZCMzkiLCJ2aXNpdG9yX2lkIjoiMzc0MDAxNzM4NjY1NjMyODUwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d5fa631d9d354a7f17686e39fb40051a973690ae29486d328e2c6c06ba808517 |
| hovercard-subject-tag | issue:3374243926 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/graphql-java/graphql-java/4107/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0adff34f23feeb18adb7c1b1ef52e86a5db577f7a66a89d74f370d1fc5d9fabe/graphql-java/graphql-java/issues/4107 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0adff34f23feeb18adb7c1b1ef52e86a5db577f7a66a89d74f370d1fc5d9fabe/graphql-java/graphql-java/issues/4107 |
| og:image:alt | Caching the parsing and validation of a document can save significant latency. For very large operations, and tools like Relay produce very large operations, the parse and validate latency can be u... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bbakerman |
| hostname | github.com |
| expected-hostname | github.com |
| None | dd6be7b30d2e12704d0d9723ad4a7950f9e3ad8461efc40b5411aad62e847a89 |
| turbo-cache-control | no-preview |
| go-import | github.com/graphql-java/graphql-java git https://github.com/graphql-java/graphql-java.git |
| octolytics-dimension-user_id | 14289921 |
| octolytics-dimension-user_login | graphql-java |
| octolytics-dimension-repository_id | 38602457 |
| octolytics-dimension-repository_nwo | graphql-java/graphql-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38602457 |
| octolytics-dimension-repository_network_root_nwo | graphql-java/graphql-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0bab932a9532ed9bc2e3e2614af9348ab39af6a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width