Skip to content

Investigation: fine-grained async control over caching behaviour #4693

@TkDodo

Description

@TkDodo

Related:

One approach would be to have another async function that runs before the queryFn (and maybe one that runs after it ?) that would skip calling the queryFn if something other than undefined was returned. Here, people could read from an async storage (and potentially write to it in the "after" hook). The query could also stay in fetchStatus: 'idle' because we haven't triggered the queryFn yet.

Combined with the possibility to customize the in-memory cache (see #4687), people would be free to keep the size of the in-memory cache small.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedv5

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions