liberapay.com
liberapay.com copied to clipboard
Widgets performance and scaling
Widgets should be generated at the edge with Cloudflare Workers. The response times would be lower and there would be no risk of a surge of legitimate requests for widgets affecting the response times of other requests.
- [ ] Write the JavaScript (or TypeScript) code. It will go into a new directory (
edge/
?) or repository (liberapay.com-edge
?). A new component will be added for it in Weblate (https://hosted.weblate.org/projects/liberapay/), with a JSON-based translations file format.- [ ] Write a function to generate donate buttons equivalent to what
~/widgets/button.js.spt
generates. - [ ] Write a function to generate “giving” and “receiving” widgets equivalent to what
~/widgets/%type.spt
generates.- [ ] Fetch the giving or receiving amount from
~/public.json
, turn it into text using Intl.NumberFormat, and interpolate that into the translation.
- [ ] Fetch the giving or receiving amount from
- [ ] Write a function to generate donate buttons equivalent to what
- [ ] Deploy the workers on temporary paths and test them.
(Previous issue: #360.)