T
TanStack•5w ago
wise-white

Time spent on reloading

Hello, i'm currently discovering tanstack, and i was wondering about something. First of all, here is the git repo : https://github.com/HussonAxel/pokemon-living-dex and the link https://pokemon-living-dex.netlify.app/ and the most significant thing is where i'm trying to reload the following : https://pokemon-living-dex.netlify.app/abilities I know that i should add a pagination to the table so it takes less time, but anyway i did some tests with a limit of 20 elements and it stills take quite a time. So i was wondering, what could i do to improve the speed page reload, besides adding a pagination ? Thanks to everyone 🙂
GitHub
GitHub - HussonAxel/pokemon-living-dex
Contribute to HussonAxel/pokemon-living-dex development by creating an account on GitHub.
2 Replies
stormy-gold
stormy-gold•5w ago
from my short look, i'd say a tiny improvement will be to fetch fetchAllBerries before opening the /abilities page then check the queeyCache if available before making an extra query, might change how you use queryOptions a bit. aside that you can limit the initial query to 3 or 4 abilities, await in server side. but also keep your fetch for all abilities, but don't awit that and stream it to the client. might take a bit of logic to get it to work but outside outright pagination that could help a bit
wise-white
wise-whiteOP•5w ago
The thing that I don't really understand is , why on the first open, it's fast. But when I reload the page it's not ? It looks like it has to refetch the data when it should be cached based on what I did I think ?

Did you find this page helpful?