You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this time I am not seeing an easy to way to know how recent the data in the cache has been set.
It would be nice to have this information accessible through the API and/or an option such as stale-time during the setup.
I am using a fetch-policy of "cache-first" for most of my queries. However, data that is more than a day/week/month old I would like to be able to purge.
The text was updated successfully, but these errors were encountered:
I believe nothing has really changed at apollo-cache-persist's options regarding cache expiration since it was last discussed in #2 and #53.
Here a few mentions worth exploring:
If your main concern is avoiding the display of stale data, perhaps you could add an updatedAt field to the time-sensitive objects and avoid displaying if they're older than a specific threshold. (Slightly more hackily, you could add a fetchedAt field that the server just writes Date.now() into and use that for filtering.) (source)
I was looking at how to do this since many times you have data you don't control or know when to evict and found this article, I hope it is useful to others here. (source)
I'll leave the issue open now just to provide a space for a fresh discussion, although I don't believe it'll lead to an actual feature as the title is suggesting.
At this time I am not seeing an easy to way to know how recent the data in the cache has been set.
It would be nice to have this information accessible through the API and/or an option such as
stale-time
during the setup.I am using a fetch-policy of "cache-first" for most of my queries. However, data that is more than a day/week/month old I would like to be able to purge.
The text was updated successfully, but these errors were encountered: