Post

Small detail about the new Planetscale homepage, there's no pop in for their Sign in / Dashboard link, it's included in first HTML payload that's sent to the client A dive into how this works and why it's interesting (sub 50ms SSRing!)

1 repost6 likes

First, a quick look at the tech stack Wappalyzer says it's Next and Remix, inspecting the HTML payload which is what we care about, it's using Remix

Next up, the response headers what can we learn from those? They're SSRing each page load, you can tell this by how the age is 0 and the X-Vercel-Cache is MISS. Along with this, the site is hosted on Vercel meaning they're either using serverless functions or edge functions

Loading the page from us-west it loads in 50ms-100ms Swapping my location with a VPN to Australia, the initial HTML takes 200-250ms to load This makes me think they're SSRing on the edge as if you compare those numbers to remix-on-the-edge.vercel.app/edge they're very similar

Looking at the auth cookie, I think they're using JWTs for auth which should mean they're able to skip doing a DB lookup for the user and so the only executing cost they're paying is the trip from the client to the edge function and back