-
|
Im a bit confused about how the caching mechanisms works with :countish pagination. When saying that it runs once per collection instead of per page, does this mean that it matches the underlying SQL instead of just the request body/params? For example lets say I have a endpoint that returns Posts for a User. Will two requests fetching posts for the same User but different page params, e.g. page=1 vs page=2, return the cached count value? Also, when saying that it will optionally recount when it's stale, is the TTL the only way to invalidate the cache? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Great questions.
That's a lot simpler than that 😉. It simply adds the count value to the
As I explained: the 2 requests will actually send back the count value to the server... so yes, the count is the same value fetched the first time (or last time if TTL has been set).
ATM... yes. Do you need something different that I didn't think of? |
Beta Was this translation helpful? Give feedback.
Great questions.
That's a lot simpler than that 😉. It simply adds the count value to the
pageparam of its URLs, so the client will send it back to the server with the request, and the paginator will split the page value from the count value, reusing the same memoized value for all the pages.As I explained: the 2 requests will actually send back the count value to the server... so yes, the count is t…