New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefetching rows from remote source #92
Comments
async function dataListener(x0, y0, x1, y1) {
if (!cache.has(x0, y0, x1, y1)) {
const data = await getDataFromServer(...embiggenViewport(x0, y0, x1, y1));
cache.set(x0, y0, data);
}
return cache.get(x0, y0, x1, y1);
} Future renders will block until a page request to this callback is complete, so you can trade off page-boundary for intra-cache performance as desired. If you are interested in a more fully-featured data model, rather than the bring-your-own approach of |
Thank you for your repsonse! Perspective is great and I was actually asking in that regard. It seems that the Perspective dataListener in case of a remote view reloads the viewed records from the remote server which causes a lot of roundtrip data sent over the wire. I was looking into the best way to implement such caching with Perspective's remote view capabilities. |
No,
All virtual data models do this, even if you increase the "page size". I think you may misunderstand how |
Is there a way to prefetch rows from a remote source?
It seems that setting setDataListener gets called whenever the viewport changes. When scrolling this generates a lot of calls to the server. What is the best way to implement a caching mechanism to load data in pages (e.g. load 100 rows instead of just the 25 of the viewport) and have the table generate a call only when needed, or when approaching the edge of the prefetched data?
The text was updated successfully, but these errors were encountered: