We’ve added an indication within the Router “request” object for the rendering process which initiated the Router code.
Up until now, the Router code was triggered twice on Production (due to SSR), and it was impossible to understand in which environment the rendering process was running.
Going forward the “request” object will hold a new “env” parameter that will indicate if the code was triggered as part of the backend rendering process or the client-side rendering process.
The "env" parameter will specify if the initiator is “browser” or “backend”, so you’ll be able to choose the code’s logic accordingly.
Read here for more info.