Skip to content

client-side caching #15549

Answered by Stormer0528
hadez0528 asked this question in Q&A
Discussion options

You must be logged in to vote

To implement client-side caching with Apollo Client, you can use the InMemoryCache as your cache implementation. When initializing the Apollo Client, you can specify the cache like this:

import { ApolloClient, InMemoryCache } from '@apollo/client';

const client = new ApolloClient({
  uri: 'https://your-graphql-endpoint.com/graphql',
  cache: new InMemoryCache(), // This initializes the InMemoryCache
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hadez0528
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants