Grid requestRows cache

I have a question about requesting rows in the grid component.
I am trying to improve perfomance for some Views where i have a Grid in fullsize using an SQL Container.
Every time i am navigating to my View, the handleRequest in VaadinServlet does some grid initialization, also in RpcDataProviderExtension.beforeClientResponse it pushes row data with my numberOfRows (for example in one screen it is 22 rows → so it takes Math.min(40,22))
In RpcDataProviderExtension.pushRowData my values look like:
Range newRange =Range.withLength(0, 22);
Range cached = Range.withLength(0, 0);

Then a second handleRequest from Vaadin Servlet starts and I have a second Request with requestRows
Range newRange =Range.withLength(5, 17);
Range cached = Range.withLength(0,5);

My question is, why is it loading on first time all 22 items and sets them as active rows and on second run, it says it only cached 5 of them?
The same Problem occurs in my gridcontainer.size is > 40. It looks like it loaded the first 40 items but then has only cached 5 so a second request takes too much time.
Am I doing something wrong? I cannot reproduce it every time, sometimes it seems for me to be random if it caches 5 or 40 items. Is there any reason?