I am using the datatables plugin in my application but due to its success the number of records increase dramatically (1000 new records each week) so my view for datatables is increasing in response time.
Nowadays I call a rest service, set up via a rest control on an xpage which is connected to a java class to populate a json array from a viewnavigator.
I can not disable the URL in the ajax call in the datatables component initiation from what I have understood. alternative I am thinking to place the json in a view- or a sessionscope and load that via a scriptblock control but I am not sure if I would gain performance here (perhaps with a button to update the scope variable).
what are your experiences/suggestions?
My first suggestion based on my experiences is to avoid loading many 1000s of records if possible. It's very hard to reproduce the Notes Client feel in a browser and most of the time there really is no need to except in rare circumstances. Have users target the information they need by searching or have categorized views in the back end and give users the option of choosing a category from a dropdown or something similar.
But if you absolutely need to load a lot of data there are a few different directions you can go ....
A big part of the load time for DataTables is the actual rendering of the table rows and columns depending on what type of logic you have for rowCallback, etc. Think about using the scroller plugin which will only render the visible rows. As you scroll the table the additional rows will be rendered. This speeds up rendering time tremendously for big tables.
If you are loading a large amount of data, like 1000s of rows, you can chunk the data requests so that the users get the initial data load (like 300-500 rows) quickly and the rest of the data is loaded asynchronously behind the scenes. Load the initial data via the ajax parameters as normal and then get the rest in the initComplete callback.
Another option is to initially load your data via ajax and store it in localStorage or session Storage and then point your DataTables "data" parameter to your local data. This does not necessarily provide a performance improvement but it answers your question about "disabling" the ajax parameter.
For example: