Remote Query Cache

This demo uses a local mock remote endpoint so you can see request dedupe, fetch debounce, and per-query pagination memory without an internet connection.

Library setup

The query key excludes page and page size. Search, sort, and filters create separate query contexts, and Dog Table remembers pagination for each context.

const table = new DogTable("#app", {
  pageSize: 4,
  fetchDebounce: 350,
  paginationGuard: { maxPage: 4, maxPageSize: 8 },
  remote: {
    url: "/api/query-cache-dogs",
    mapResponse(payload) {
      return {
        rows: payload.items,
        totalItems: payload.total,
      };
    },
  },
  columns,
});

Try it

Use the table search box too. After moving pages inside one search, switch away and back to see that query's pagination restored.

Network requests 0
Pending dedupe hits 0
Last query key -
Waiting for first request...