Server‑side processing versus client‑side Ajax loading in DataTables for preserving filter state on reload
25K reputation · 29 Dec 2021, 02:23 UTC
When working with large datasets in DataTables, developers must decide between enabling server‑side processing (serverSide:true) and loading the full data set once via Ajax (serverSide:false). The goal is to retain the table’s filter, sort and page state after a page reload while keeping initial load time and memory usage within acceptable limits. Server‑side mode reduces the initial payload but depends on the server echoing back the applied search terms for stateSave to work correctly; client‑side mode stores state locally but incurs a larger initial download and higher browser memory consumption. This trade‑off raises uncertainty about which approach reliably preserves filter state without sacrificing responsiveness.
Which configuration guarantees that filter state persists after reload when stateSave is enabled? Does server‑side processing require additional server‑side logic to reflect search terms, and how does that affect implementation complexity? Under what dataset size does the client‑side Ajax approach become impractical due to memory constraints?