cashay icon indicating copy to clipboard operation
cashay copied to clipboard

Support TTL on a per-field basis

Open mattkrick opened this issue 8 years ago • 1 comments

Every prop on the server GraphQL schema should be given a __ttl field that is automatically requested by cashay. When received by the client, an expiresAt field is generated on the parent object and the earliest time trickles up to the parent array and parent query, etc. It's run during the GC cycle, about every 5 mins. Removing it from normalized data, which invalidates the denormalized response and triggers a series of refreshes that only occur during a redux listener call, so thing out of the view stay deleted. That means no unnecessary data is fetched and we can store data in a persisted state. It also fails gradually, so it's "progressive"

CC @wenzowski

mattkrick avatar Apr 20 '16 13:04 mattkrick

You could take a look at Falcor's expiration implementation ($expires): https://netflix.github.io/falcor/doc/global.html#Atom

Falcor does a lot of nice things :)

mullender avatar Sep 15 '16 02:09 mullender