danielemery / quizlord-api

Graphql api for sharing newspaper quizzes between friends, including results and statistics
https://quizlord.net
MIT License
1 stars 0 forks source link

Hydrate cloudflare Germany CDN on quiz upload #97

Closed danielemery closed 4 months ago

danielemery commented 4 months ago

Currently there is an issue that when a user in Germany attempts to load a quiz that no one else has already loaded it results in a cloudflare cache miss and takes a very long time to load (sometimes 1-3minutes).

In order to avoid this some new SQS queues should be created (one for each affected region - at this stage only Germany).

A simple Bento container located in Germany can then consume from this queue and hit the image url in order to have Cloudflare cache the image before the first user requests it.

This is not expected to be a perfect solutuion as cloudflare will likely purge this cache after some time. But the hope is that it helps.

danielemery commented 4 months ago

This has been done out-of-band It required only changes to the terraform project and implementation of a simple bento container When terraform is migrated into this repo along with the bento config (and corresponding k8s resources) the implementation will be clear.