For all big page reloads, we want the `<head>` of the page to start being transmitted even while doing database requests. So let’s use the `Wai.ResponseStream` to do exactly that. The handler provides the contents of `<head>`, we start streaming that, meanwhile it calculates the `<body>` and once that is ready transmits it. This means we can load all our static resources before the page even starts sending any body data, meaning the css and html is already there when we reach `</html>`. Sweet. The `<title>` in `artistPage` was depending on the table data, so I moved it into a separate SELECT. We can do all of it in parallel as well. Sweet. ~~~ This also adds static file prefetching of source maps if provided. Change-Id: Ib824430594733b4c8e86ee1096c8afba2df1a66d Reviewed-on: https://cl.tvl.fyi/c/depot/+/13221 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI |
||
|---|---|---|
| .. | ||
| services | ||
| src | ||
| .gitignore | ||
| build.ninja | ||
| default.nix | ||
| Main.hs | ||
| notes.org | ||
| README.md | ||
| server-notes.org | ||
| whatcd-resolver.cabal | ||
whatcd-resolver
To run:
ninja run-services
in one terminal (starts the background tasks)
ninja run
to start the server. It runs on 9092.
You need to be in the nix-shell in ./...
You need to set the pass key internet/redacted/api-keys/whatcd-resolver to an API key for RED.
You need to have a transmission-rpc-daemon listening on port 9091 (no auth, try ssh port forwarding lol).