Closed Alex-At-Home closed 1 year ago
Note that I believe every request to the player leaderboard if any of them are >5MB costs me GCS transfer monies also
Maybe add a line to the ingest pipeline to not transfer any files that are >=5MB?
Couldn't immediately get the direct gz working
const respBlob = await resp.blob();
const respBinaryArray = await respBlob.arrayBuffer();
/**/
console.log(respBinaryArray.byteLength);
//const respJson = await resp.json();
res.setHeader("Content-Encoding", "gz");
res.setHeader("Content-Type", "application/json");
res.setHeader("Cache-Control", "s-maxage=28800"); // requests that the CDN cache this for 12 hours or until the app redeploys
// res.status(200).json(respJson);
res.status(200).send(Buffer.from(respBinaryArray));
Returned and send a binary object but wasn't able to decode it as JSON
Ah GCS also caches the data for an hour, which isn't ideal
Options:
Cache-Control
For now I added cacheId=${process.Env.VERCEL_URL}
which I think but haven't confirmed will update on each redeploy (but otherwise should give 1 hr)
Ended up getting compression working
2021/22 players Low tier got that high
Options:
.gz
files and then send the binary without decompressing