Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update caching docs #1818

Open
wants to merge 9 commits into
base: source
Choose a base branch
from
Open

Conversation

mandiwise
Copy link
Contributor

Description

This PR expands on the existing caching content for the Learn docs so that it addresses broader performance topics. Key changes include:

  • New content on using GET to facilitate caching, the N+1 problem, performance monitoring, and more
  • Page has been renamed "Performance" (with redirect from old route)

@benjie @jorydotcom

Copy link

vercel bot commented Nov 5, 2024

@mandiwise is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@saihaj saihaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep a dedicated caching page on that page we can talk about different caching techniques used within community: Document Caching, Response Caching, Partial Query Caching.

We can talk about performance and add more things to that page. The performace page can link to the caching page. Performance is a broader topic, we can even take things like Trusted documents and refer in performance section.

Copy link
Contributor

@Urigo Urigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great content!

I agree with @saihaj 's sentiment around leaving the caching specific page and linking to it from there (there is a lot of opportunities to expand that page and a lot of users are Googling that terms)

src/pages/learn/performance.mdx Show resolved Hide resolved
src/pages/learn/performance.mdx Show resolved Hide resolved
@mandiwise
Copy link
Contributor Author

let's keep a dedicated caching page on that page we can talk about different caching techniques used within community: Document Caching, Response Caching, Partial Query Caching.

We can talk about performance and add more things to that page. The performace page can link to the caching page. Performance is a broader topic, we can even take things like Trusted documents and refer in performance section.

@benjie I can transfer the "Globally unique IDs" content back to a dedicated Caching page and leave the rest of the content on the new Performance page. A deep dive into focused caching topics on the Caching page would need to be scoped to a separate project. Let me know how you would like to proceed.

@benjie
Copy link
Member

benjie commented Nov 21, 2024

@benjie I can transfer the "Globally unique IDs" content back to a dedicated Caching page and leave the rest of the content on the new Performance page. A deep dive into focused caching topics on the Caching page would need to be scoped to a separate project. Let me know how you would like to proceed.

This involved a little thought... Really Globally Unique IDs aren't just for performance, they're for identity which can relate to mutations and URLs and all sorts of things. From a quick scan of the existing page, I think what it was really talking about was normalized caching which also relates to rendering consistency, updating data after mutations, and other topics. Definitely we should move it off of the performance page...

Saihaj is right that in addition to normalized caching (Global Object IDs or otherwise) there are other approaches to (client-side) caching and they each have their own trade-offs - but they also solve slightly different (but overlapping) problems - and I'm not sure that "caching" is even the right title for that... There's also other forms of caching that relate to GraphQL such as caching within proxies (like Cloudflare), caching of parse/validation results, and even caching in the business logic layer such as within DataLoader - and I'm not sure those would belong on the same page! They definitely seem more "performance" related to me.

For now, let's do as you propose and move Node IDs (all the way up to the end of "Alternatives") back to the "caching" page. Any additional content about alternative techniques can be proposed via future PRs. Ideally we'll come up with a better name that essentially means "GraphQL-focussed client-side data storage and synchronisation techniques" but, you know, pithier...

@mandiwise
Copy link
Contributor Author

For now, let's do as you propose and move Node IDs (all the way up to the end of "Alternatives") back to the "caching" page. Any additional content about alternative techniques can be proposed via future PRs. Ideally we'll come up with a better name that essentially means "GraphQL-focussed client-side data storage and synchronisation techniques" but, you know, pithier...

Addressed in 6f7fa7b

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vast majority of this is great content as-is; I've noted some recommended changes to a few small areas below.

src/pages/learn/performance.mdx Outdated Show resolved Hide resolved
src/pages/learn/performance.mdx Outdated Show resolved Hide resolved
src/pages/learn/performance.mdx Outdated Show resolved Hide resolved
Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the only remaining issue is the N+1 demonstration; then this is good to go! 🙌

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; thanks for all your hard work on this! 🙌

Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphql-github-io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2024 5:37pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants