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?
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 sounds like it would be excellent for speeding up stuff that doesn't need speeding up.
@AlanBell well... yeah. This is more that I'm looking at resellable static hosting providers and this compile-a-wasm-binary-webserver trick is a consequence of the way fastly does it, rather than that I *want* this wasm thing :)
@sil Whole thing is straining to find another use for their edge compute rather than having a solution that's good for static files
(The vole site is 99% static so I've considered making it 'serverless' but always run into some kind of nonsense that makes me run back to cheapo hosting with a CDN in front)
@mattround it does seem terribly over-engineered! I mean, call me a cantankerous old man, but...
@sil @mattround I'm a huge wasm fan and love the idea of compute@edge and similar edge-deployed wasm runtimes but this just seems silly.
Instead of serving a static file we compile all your static assets into a (webpack!) bundle just so we can then run it in a wasm-compiled JS engine?!
@sil like it's a cool hack and all but who came up with the idea of marketing this to people as an actual solution to static site hosting??
@flaki yeah, @mattround 's point that it feels like the tail wagging the dog rather seems convincing here...!
@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.
@robinwhittleton ah. But the CDN requires me to actually host the site somewhere else. https://www.fastly.com/blog/no-origin-static-websites-at-the-edge/ suggests that if I want to host it at fastly, this compute thing is the way, no? Did I misunderstand? Certainly avoiding all this wasm compilation stuff feels sensible
@sil tbf I’m no expert We’re not actively using their CDN, just engaged with Fastly for edge compute. So you’re probably correct here. Maybe it’s the case that your usage falls in the gap?
@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.
@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 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.
@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!
@anildash @robinwhittleton @glitchdotcom gotcha! That makes sense. I understand about deploying elsewhere and then using the CDN (and Glitch is cool), but doesn’t work for what I want for boring non tech reasons :) and I’ll keep an eye on what’s coming up. (And I’ll get the name right, too, cheers for that!)
"Static websites are fast, yet powerful and seen as the next big thing in publishing to internet."