Hacker News new | ask | show | jobs
by WimLeers 3903 days ago
This does not explain how the client-side cache is kept up-to-date. Cache invalidation matters. You want instantaneous updates on the client if the data has been updated on the server. E.g. What if the like count has been updated?

Curious what solutions GraphQL offers for this. If it doesn't solve this itself, then what do GraphQL apps do today to solve this?

2 comments

Facebook does have an internal solution for push updates, I believe they use long http requests. There were some talk of relay adding support for updates via websockets, anyone have any information?
Interesting; I'd love to read _what_ exactly they send in those long HTTP requests.

I'd think something along the lines of Surrogate Keys/Cache Tags would make sense:

- https://www.drupal.org/developing/api/8/cache/tags

- http://info.varnish-software.com/blog/advanced-cache-invalid... (ugh, they broke their site, cached at https://pinboard.in/cached/a31c4630dd2d/)

- https://www.fastly.com/blog/surrogate-keys-part-1

- https://blog.cloudflare.com/introducing-a-powerful-way-to-pu...

Woah, thanks for those links. All very useful.
There's been some mention of supporting subscriptions, but I haven't heard anything about implementation. I think it's on their roadmap.