Middleware can depend on query string. Middleware runs once per navigation, wherever. This works wonderfully for first SSR load from a living server.
However, when generating pages, query
is always {}
.
So, when a static page is accessed with a query string (from another site, bookmarks, chat) the resulting page is as if there was no query string, since the middleware is pre-executed only.
Hence, middleware depending on query is broken on static load.
What should we do?