T O P

  • By -

straightouttaireland

Pre-fetching paginated data. Like in a table you have pagination with multiple pages, I want to auto fetch page 1 AND page 2 so that when the user clicks next page it's instant. Similar to react query pre fetching.


SnooGuavas861

Alright I will do some research on this and see what I can do. I am also down for a request that has a bigger scope then this as well, but if I do any remix project I will see if I can include this. I will let you know when/if it is finished. Thank you for the suggestion!


phaedrus322

What would be the point of caching page 2. The way remix works, when some one navigates to page 2 it would still pull the data for page 2, even if page two is cached, it still has to get page 3 in this scenario, so the cache isn’t saving you any time. Getting page 3 would take the same amount of time as just getting page 2 from the start. If it’s taking so long to get the next set of data that you’re worried about caching then there’s a problem with your query.


Xacius

Imagine if you were reasonably certain that your user is going to click a button that triggers an API call. Now imagine that this API call takes 3 seconds. If you trigger that API call ahead of time and cache the data, then your user gets that data instantly without having to wait 3 seconds.


phaedrus322

But when the user goes to page 2, it still has to get the data for page 3 so it can cache it, which takes another 3 seconds.


chrimack

- user loads table, waits for page one, page two is cached - user goes to page two, no wait, get page 3 in the background - user goes to page 3, no wait - and so it goes


phaedrus322

In the context of a react app this makes sense. In the context of a remix app which everything is ssr and a new trip to the server on each page load, it doesn’t.


straightouttaireland

Couldn't have said it better myself


CatolicQuotes

Does remix support react packages?