Cache Rate for Vaadin 24.6 Grid

Hi,
Beyond the page size of a grid, I would like to get more control of the cache rate for loading lazy view with backend data. Even with a view that can display 30 records, and a page size of 50, when loading the grid, i still have 2 round trips with the backend, 0-50, then 50-100… which is, in some case, not needed/expected.

In the past, there was a setCacheRate method, but it do not exists anymore.

How then can I control it ?

Best regards

Alexandre

1 Like

You can take a look at improving-scrolling-behavior, and see if it what you are looking for

I’m afraid the current Grid doesn’t have those configuration options. At least I have only found a way to define the page size (affects also how requests are made to the backend when lazy loading data from backend), but no way to control e.g. how many rows the client side ensures there is in “buffer”. For example if you set pagesize to 10, for an undifined sized grid, that shows about 9.5 rows on the screen), you still get three queries to your backend :man_shrugging:

You could increase the page size of the grid.
We faced the same issue with up to 3 times loading 50 items. After we set the page size to 150 it only loaded once.

this.grid.setPageSize(150);