Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching by default #5

Open
Laurin-W opened this issue Aug 13, 2024 · 0 comments
Open

Add caching by default #5

Laurin-W opened this issue Aug 13, 2024 · 0 comments

Comments

@Laurin-W
Copy link
Contributor

I think for the boilerplate, it makes to add default caching, like we do for mastopod now. Most apps aren't too time-critical, I suppose. We can leave a comment in the App.tsx file and set a small default.

What do you think?

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      refetchOnWindowFocus: false,
      staleTime: 1 * 60 * 1000, // Consider data fresh for 1 minutes
      cacheTime: 30 * 60 * 1000, // Cache unused data for 30 minutes.
      retry: 3,
    },
  },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant