explorer icon indicating copy to clipboard operation
explorer copied to clipboard

Remove redirect in SSR

Open beguene opened this issue 3 years ago • 0 comments

We could remove the redirect in the nextjs middleware to shave ~300ms off the first request and improve our SEO. below an example where it's ~590ms, but this can vary. image

The middleware does a redirect because it handles first the chainId (mainnet or testnet), but we could maybe try to handle it client side without using any store server side if the request has ?chain=mainnet or ?chain=testnet => nothing to do, the current code handles this if the request does not have ?chain=X or X is invalid, default to mainnet and set the query params client side and set the activeNetwork to mainnet)

At least we should ignore woff fonts and the favicon.png redirects

beguene avatar Jul 12 '22 11:07 beguene