Comment

Comment by mxstbr

Our GraphQL Edge Cache is based on Fastly's infrastructure, so we do use Varnish under the hood for the cache storage. In order to properly support GraphQL at the caching layer you have to understand GraphQL so you can do fine-grained invalidation.[0]

Essentially, our GraphQL Edge Cache is similar to a GraphQL client. It looks at the request body with the query & the response with the typenames and tags the cached query result with all the objects contained within. E.g. a getBlogPost query that fetches the blog post and its author will be tagged with BlogPost#asdf123 and User#gjkd489. Then we can invalidate whenever those specific objects change.

[0]: https://docs.stellate.co/docs/purging-api

parent mxstbr 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton