1
0
mirror of https://github.com/tormachris/cf-workers-status-page.git synced 2025-07-16 20:15:14 +02:00

feat: optimize KV storage read/write operations

- the state is now stored in a single KV key
- there is one write for cron and one read for render
This commit is contained in:
Adam Janis
2020-11-19 18:43:33 +01:00
parent 293dff9425
commit c5b9232eb2
7 changed files with 71 additions and 133 deletions

View File

@ -12,7 +12,7 @@ You'll need a [Cloudflare Workers account](https://dash.cloudflare.com/sign-up/w
* A workers domain set up
* The Workers Bundled subscription \($5/mo\)
* [Try it now with the free tier!](https://blog.cloudflare.com/workers-kv-free-tier/) Check [more info](#workers-kv-free-tier) on how to run on Workers Free.
* [It works with Workers Free!](https://blog.cloudflare.com/workers-kv-free-tier/) Check [more info](#workers-kv-free-tier) on how to run on Workers Free.
* Some websites/APIs to watch 🙂
Also, prepare the following secrets
@ -85,8 +85,8 @@ You can clone the repository yourself and use Wrangler CLI to develop/deploy, ex
* `SECRET_SLACK_WEBHOOK_URL`
## Workers KV free tier
The Workers Free plan includes limited KV usage, in order to not deplete the quota and still have enough room for monitor status changes we recommend the following changes:
* Change the CRON trigger to 5 minutes interval (`crons = ["*/5 * * * *"]`) in [wrangler.toml](./wrangler.toml)
The Workers Free plan includes limited KV usage, but the quota is sufficient for 2-minute checks only
* Change the CRON trigger to 2 minutes interval (`crons = ["*/2 * * * *"]`) in [wrangler.toml](./wrangler.toml)
## Known issues