Skip to content

SpeedTestSchedule

Source: src/Cloudflare/Speed/TestSchedule.ts

A recurring Cloudflare Observatory (Speed) test schedule — Cloudflare runs a Lighthouse test against a page on your zone on a DAILY or WEEKLY cadence from a region of your choice.

A schedule’s identity is the (zoneId, url, region) triple: the API keys schedules per URL and region, rejects duplicates, and has no update call. Changing url, region, or zoneId therefore replaces the schedule, while a frequency change is converged in place (delete + re-create under the same identity). Creating a schedule implicitly enqueues an initial test run.

Plan quota applies: the number of allowed schedules per zone depends on the zone’s plan (e.g. 5 on Free/Pro) — see the Observatory availabilities endpoint for the zone’s remaining quota.

Safety: schedules carry no ownership markers. When there is no prior state, read reports an existing schedule for the same (url, region) as Unowned, so the engine refuses to take it over unless --adopt (or adopt(true)) is set.

Weekly test of the home page

yield* Cloudflare.SpeedTestSchedule("HomePageSpeed", {
zoneId: zone.zoneId,
url: "example.com/",
frequency: "WEEKLY",
});

Daily test of a specific page from Europe

yield* Cloudflare.SpeedTestSchedule("PricingSpeedEU", {
zoneId: zone.zoneId,
url: "example.com/pricing",
region: "europe-west2",
frequency: "DAILY",
});