This week I started looking into Fastly’s Compute@Edge service, as a possible means of handling some bits of dynamic content on GOV.UK (for example, showing the appropriate sign in / sign out link in the header, without every request needing to hit our origin servers).
Currently we do our CDN configuration with lots of VCL, which has a big downside: Fastly use their own fork of Varnish, so we can’t run or test this VCL locally. You just have to make your change, deploy it to staging, and manually check.
But Compute@Edge would let us use Rust or AssemblyScript, which in principle can be run locally, though the situation there isn’t so great either:
- Fastly’s Rust crate depends on some hidden code which their runtime injects. So you can run integration tests locally where you use their local runtime to run your WASM binary and fire requests at it, but unit tests are a bit trickier.
- Their “hello world” AssemblyScript project crashes, which is very unpromising and makes me wonder what more subtle bugs are lurking, if something this blatant slipped through.
The downside of using Compute@Edge for some accounts-related functionality is that we’d have another layer in our CDN stack. This could be pretty confusing, as all the network hops inside Fastly’s network go through cache nodes.
We’d likely stick the Compute@Edge logic between our current VCL and our origin servers, so we’d end up with something like:
In either case, it’s kind of confusing having two layers of custom CDN logic. Now, Rust is a much nicer language than VCL, so perhaps we’d end up merging the VCL into the Compute@Edge code and doing it all there, and then we could have fully tested CDN logic, which would be very nice.
But deciding to rewrite how our CDN works is a little outside the scope of the accounts team, so I’d need to build up some support first.
This week I read:
The Stars My Destination by Alfred Bester
It’s the future, humanity has colonised the solar system, and a great breakthrough has been made: the ability to “jaunte”, or teleport up to about 1000 miles merely by thinking. The book starts with Gully Foyle, the narrator, running low on air in a derelict spaceship, who watches another craft approach, notice his distress signal, and leave him behind.
Most of the book is a Count of Monte Cristo-esque revenge tale, with a subplot of some very rich men trying to recover a secret treasure which Foyle’s ship had been transporting. It’s a good read, and I enjoyed it a lot.
I’m glad that the original title of “Tiger! Tiger!” got dropped, as “The Stars My Destination” is much better.
- Level One Wonk: Fantasy Economics
- 11 ways to be a better roleplayer
- Running Session Zeros
- Running Episodic Games
- The 7-3-1 Technique
- Starship Geomorphs 2.0