Looking at Fastly for hosting static websites, which https://www.fastly.com/blog/no-origin-static-websites-at-the-edge/ claims it can do with "compute@edge", and I have fallen at the first hurdle. I dropped a reasonable-sized static site into a public folder and ran "fastly compute serve" and... "memory index 0 has a minimum page size of 3075 which exceeds the limit of 2048". This seems to be some sort of hardcoded limit in "viceroy", the server; someone talks in a bug about recompiling it. Do I know any fastly peeps? @devs maybe?
@sil@robinwhittleton Hey! I lead the compute + dev stuff at Fastly; thanks for trying it out, and for the feedback. And yep — it's a little convoluted! Obviously most folks aren't going to use all of that tech just for static pages, but we do have customers who wanted to use the platform that way, so that's why it's documented that way. We're in the midst of revamping this to be simpler as more people use it, so please do let us know how it *should* work for you. Thanks again for the feedback.
@sil the goal of Compute@Edge isn’t to quickly serve some static files (they’ve got a CDN for that) but to process your data on the edge servers to personalise to users. The classic example they give is shipping a podcast episode with ads in: Fastly’s servers can geoloc the user, split the audio at defined points, insert up-to-date country-specific ads, splice the audio, and serve the file, all from the same URL. WASM (theoretically) gets them super-quick spin-up times on each request.
It seems to compile a big WASM blob? Unsure about this. In particular, if it serves out the HTML that I actually wrote, then.... OK, I suppose? This seems a very complicated way to go about things, but whatever, it's invisible, so I'm testing it. If it serves all that wasm to the actual users then it's going straight in the bin. But... currently, the server doesn't seem to be able to even serve this wasm monstrosity it creates, so maybe it only works for a one page website. All seems v complex!
OK, confirmation at least that all this wasm stuff is invisible server hosting; it does not appear to actual users. So instead of copying your files to a web server, you instead use their tools to compile an application which embeds all your files, and then deploy that compiled binary application on Fastly's infrastructure. That seems complex, but it maybe works (at least, on trivially small static sites). This makes problem diagnosis sound hard to me, but maybe it's OK, if complicated.
@sil@robinwhittleton well, you've already discovered that, at least from a UX perspective, we're not great at it! But we do want to get better at it. This is ... something we're deep in the midst of working on. (Guess who has never worked at a publicly-traded company before and is not sure what he can say when!) I will get you a better answer asap. In the meantime, I use @glitchdotcom as origin for my stuff (that's our friendly tool) and then deliver it through Fastly.
@anildash@robinwhittleton Thank you! My basic question is: can I use Fastly to publish a static website, the same way I might use, say, surge? That is, not publish it somewhere else and put Fastly's CDN in front of it; do it with just a Fastly account. As far as I can tell, deploying it as a big wasm binary to compute@edge is the suggested way to do that, but... at least the local server fails on moderately-sized static sites (and I fear publishing would charge for memory use and be expensive!)
@anildash@robinwhittleton if the answer is "yeah, that's not really what Fastly is for, don't publish your whole big static website in compute@edge, and we don't do static hosting, so publish it somewhere else and then use our CDN to front it, our CDN's great" then I'm fine with that answer; what I don't know is whether that really is the answer or if there is a different or better way that I don't know about. I know nobody likes to say they're not best at a thing, though :-)
@sil@robinwhittleton@glitchdotcom oh, and a very important personal peccadillo: it's just "Fastly Compute" now. We got rid of the weird @edge stuff, just made it simpler. First the name, next the tools!