Channel
Interviewed Person
Various
$46,000 Vercel bill. How does that possibly happen? This was the creators of Jmail. They've taken every single one of the Epstein emails and built this like Gmail interface so you can sort of click through and read them and load them and filter them by different people. It's a really sick website but they've racked up a $46,000 Vercel bill. I have large sites running on Vercel, Cloudflare, and VPS and I did some quick back of the napkin math and I think I know
where most of this bill went to and we're going to break it down so hopefully it doesn't happen to you as well. Let's break it down into four sort of categories. You got compute, bandwidth, requests, and like special add-on services, right? So compute is when your application actually needs to run some processes, right? Whether it's fetching data from the database, looping over arrays, whether it's handling a URL and routing it to wherever you go, that is when your server actually needs to do work. And almost all of the content on this website actually is fairly static content,
right? If you go ahead and look at a lot of these requests that are coming in, you'll see that it's just JSON that's coming in, right? So it's just text. Text can be cached very heavily. The stuff on here is not changing very often. The guy's dead, right? He's not sending any more emails. Well, I guess that's maybe up for debate but there's a lot of stuff that can be cached on here. So I don't know. It certainly is probably a big expense here but probably not the biggest
one because they're not doing things like they're not OCRing on demand. They're not doing any really heavy intensive stuff. They are somebody just rendering out React elements on a page and then caching those heavily. So the next one is bandwidth and this is probably a big one but not what you might think, right? You think like, oh, images and whatnot. So if you go to one of the images that are on this website, you'll see that they are hosted on a totally separate domain name. And this URL here and looking at the headers tells me they're using Cloudflare image
transformations to resize them. So they're not as big to load on page load and they're not using up as much bandwidth. So most of the images on here are not even part of that Vercel bill because they're hosted totally separately. But if we go let's go to this home page here do a hard refresh and then sort them by size. You'll see there are some things that are being hosted on this. This biggest one right here is over half a meg for a little icon that's being loaded here.
If we open that up in a new tab, this is a little Facebook icon not compressed at all and probably way larger than it needs to be and probably could be in SVG. So serving that up plus there are several other images that are being loaded in here and adding all those up it's about a meg. Plus you're looking at all of the JavaScript and CSS bundles that are being loaded up. That's probably close to another meg as well. So every single person visiting the website fresh cache,
they're using two megs of bandwidth which is quite a bit. Then the other part of the bandwidth here is this aggressive pre-loading. So if I go to my dev tools I'm going to filter for XHR and then as I simply just scroll you'll see that there's like tons of requests being being fired off. Now I have my cache disabled here so they are loading from my disk cache but
the first time that you hover over top of those you'll see it's just a bunch of JSON being loaded but they are aggressively loading them all in. Now that is a very high trade-off and I did a video about how McMasterCard does this as well because now when you when you click on some of these they load extremely fast. Quite honestly it's faster than Gmail. This is a very good experience. So you have a bit of a trade-off where yeah I will aggressively pre-load everything in even