cement4357
TTCTheo's Typesafe Cult
•Created by gybia on 7/22/2023 in #questions
What is prefetching in TRPC server side?
I don't really think so, prefetch will add the query to the cache, which you then dehydrate and send to the client.
10 replies
TTCTheo's Typesafe Cult
•Created by gybia on 7/22/2023 in #questions
What is prefetching in TRPC server side?
Yes, that's totally okay, just in your case, you want to use gSSP or gIP and prefetch ur query there
10 replies
TTCTheo's Typesafe Cult
•Created by gybia on 7/22/2023 in #questions
What is prefetching in TRPC server side?
keep in mind that prefetching in your main page might be slower than calling your route staightaway with useQuery or however you name it
10 replies
TTCTheo's Typesafe Cult
•Created by gybia on 7/22/2023 in #questions
What is prefetching in TRPC server side?
Prefetching is exactly what it sounds like to be, it is prefetching some kind of query, which you can call back later with prefetched data instead of calling query.
It is meant to be used in serverside so ie. in exported function of getServerSideProps - an example:
and then you if you fetch the data in the component with exactly the same parameters, you will get prefetched data from gSSP instead of naked useQuery call
ie.
not sure if it is gonna work if you are using 'use client' statement tho
10 replies
TTCTheo's Typesafe Cult
•Created by cement4357 on 2/24/2023 in #questions
Prefetching more items than requested on client side
I wanted to create something like a step ahead of user - so one more query would be always prefetched
15 replies
TTCTheo's Typesafe Cult
•Created by cement4357 on 2/24/2023 in #questions
Prefetching more items than requested on client side
Don't really see any prefetch extension on my components using trpc
15 replies
TTCTheo's Typesafe Cult
•Created by cement4357 on 2/24/2023 in #questions
Prefetching more items than requested on client side
So far I was using regular client-side queries and it was pretty much very fast, you mentioned prefetching on the client-side - what exactly did you mean? Would be nice to prefetch more queries if previous one is already loaded!
15 replies
TTCTheo's Typesafe Cult
•Created by cement4357 on 2/24/2023 in #questions
Prefetching more items than requested on client side
Yup, was thinking about most of the things with gssp, but prolly I don't even have enough cpu power on my nodes lol
15 replies
TTCTheo's Typesafe Cult
•Created by cement4357 on 2/24/2023 in #questions
Prefetching more items than requested on client side
Ah, alright bro, thanks for quick response! I was also wondering about those performance issues prefetching too many items at once!
15 replies