top | item 11781119

(no title)

bunkat | 9 years ago

Has anybody figured out how you do caching and cache invalidation on the client with GraphQL if every page is requesting slightly different forms of the same data? Seems like it is a bigger win to just download the 400 friends once and let the pages use the data they need instead of downloading the 400 friends 10 different ways.

My particular app is read heavy and so I can eliminate the majority of the server calls altogether via caching. While GraphQL would help me fetch only the data I need on each page and decouple the data access, I don't see how I reuse objects across pages without interrogating the GraphQL queries. I haven't given it all that much thought though so maybe I'm missing something.

discuss

order

syrusakbary|9 years ago

I think is worth to take a look into Facebook's dataloader. Instead of having a caching mechanism (likve Varnish) in your HTTP layer, you could have it in your GraphQL backend.

https://github.com/facebook/dataloader

mparis|9 years ago

Great suggestion. We are currently working on getting this setup on our side!