create-tsrouter-app with Start and Query creates a server-side cache?
I set up my app using create-tsrouter-app, which created a router that imports the TanStack Query client from another file. However, this appears to preserve the server-side query client so that, when loading a page, previous queries that were not involved with the request are also dehydrated and shipped to the browser. Restarting the server eliminates this additional dehydrated data. This strikes me as a security concern. Simply creating the query client inside the
createRouter
function as shown in the Start docs resolves the issue. Can @Manuel Schiller or @Tanner Linsley let me know if I'm doing something wrong?

0 Replies