Open danielroe opened 1 year ago
Related PR and description: nuxt/framework#3985
initialCache
flag was introduced in nuxt/framework#3985 as a way to revert the effect of the change we have. It is not a caching strategy.
We could have another issue for force-fetch or track via (#2973). It is not a caching strategy exactly either and removed in same nuxt/framework#3985 PR to be supported back via a better API and also cancel support.
More I think higher-order composables or asyncData handlers with a cache wrapper can provide caching strategies for fetcher. The handler can return the cached value. And such wrapper could be more veastile than having a built-in fixed implementation of cached functions i was initially proposing in nuxt/framework#3985.
For data fetching composables, we offer
initialCache
which can either be switched on or off. But in some cases, users may have more advanced strategies, such as refetching after a certain time period or when the tab is reactivated.Some use cases: