usePaginatedQuery never hits the cache (on the same client)
pagination is often used to reduce the number of rows scanned in the backend, and lazily load rows.
Problem: When applying usePaginatedQuery, the cache is always missed when navigating between pages, that share a convex client.
Example flow:
If users want to always bust the cache, they can add a parameter to args to do it. This also allows more granular control (e.g. embedding the screen name that the user is accessing from) to determine which screens share a cache and which screens don't.
Reference: https://github.com/get-convex/convex-js/blob/250cf7985f5e69817e2b51d4558c166940b870c5/src/react/use_paginated_query.ts#L373-L400
Problem: When applying usePaginatedQuery, the cache is always missed when navigating between pages, that share a convex client.
Example flow:
- User loads app (convex context at root)
- User goes to page 1 (load paginated query)
- User navigates to page 2 (unmount paginated query)
- User navigates to page 3 (load paginated query) - this misses the cache
If users want to always bust the cache, they can add a parameter to args to do it. This also allows more granular control (e.g. embedding the screen name that the user is accessing from) to determine which screens share a cache and which screens don't.
Reference: https://github.com/get-convex/convex-js/blob/250cf7985f5e69817e2b51d4558c166940b870c5/src/react/use_paginated_query.ts#L373-L400
GitHub
TypeScript/JavaScript client library for Convex. Contribute to get-convex/convex-js development by creating an account on GitHub.

