How to Edge Cache GraphQL APIs
summary
Claims that GraphQL can be cached at the edge using GraphCDN and deployed on Fastly compute@edge, with global invalidation completing in about 150 milliseconds. Explains normalized caching via __typename plus id, shows list-invalidations require manual hooks, and mandates including the authorization token in cache key to avoid leaks. Demonstrates a working edge cache that tags objects for global purge, reduces origin load, and preserves per-user authorization while serving cached GraphQL responses worldwide.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:33The Story of a GraphQL CDN
- 4:48Why Cache GraphQL
- 7:03Can I Cache GraphQL at the Edge
- 7:26How GraphQL Clients Cache
- 9:56GraphQL Invalidation
- 10:21List Invalidation
- 10:48Creating a New Post
- 11:01Manual Invalidation
- 11:20Manual Invalidation Example
- 11:34GraphQL Invalidation Example
- 12:02GraphQL Refetch
- 13:54GraphQL Data Structure
- 14:22GraphQL for Cache
- 15:08Can I just run GraphQL at the edge
- 16:00Authorization
- 17:31Authorization Token
- 18:06Global Invalidation
- 18:53Fastly Invalidation
- 22:29Outro
related talks
24mHow to cache GraphQL queries at the edge
23mHow to edge cache GraphQL APIs
25mGraphQL and caching - Why is it so hard, or is it?
37mCaching Deep Dive: The Ultimate Way To Speed up Your GraphQL API
28mEdge Caching Dynamic Rails Apps
12mHow @Defer and @Stream Will Improve GraphQL Caching
21mCaching GraphQL APIs
24mGraphQL Clients
