Skip to content

Rule schedules

A schedule makes a rule apply only at set times, or stop at set times. You can add a schedule to any rule: a proxy, a redirect, a custom response, a bot challenge and so on. The Quant edge checks the schedule on every request, in the time zone of the rule, so no job has to run in the dashboard to make the switch happen.

A schedule has a mode and a list of windows:

  • Apply only during: the rule applies inside the windows and is skipped outside them.
  • Apply except during: the rule applies outside the windows and is skipped inside them.

A window is either weekly (for example every night from 22:00 to 07:00) or a one-off range (for example from 6 pm on 3 December to 9 am on 5 December). A rule with no schedule, or with a schedule that has no windows, behaves as it did before.

While a rule is skipped, the edge checks the next rule in the list, as it does for a disabled rule. See how rules are evaluated.

The main use of a schedule is a break-glass switch: during a window the site serves its static copy, and the CMS or application behind the proxy rule gets no traffic from the edge. The static copy is the copy of the pages that the crawler stored in the project, the same copy that failover mode uses. At the end of the window the proxy rule applies again by itself.

Some examples:

  • Serve the static copy every night from 22:00 to 07:00 and all weekend.
  • Serve the static copy from the evening a critical flaw in your CMS is announced until the morning after the patch is due.

Before you add the schedule, make sure the static copy is complete. During the window, a page that is not in the copy returns 404.

To set up the switch in the dashboard:

  1. In the project, open Traffic > Rules.
  2. Open the menu at the end of the proxy rule’s row, and choose Edit.
  3. In Conditions, find the Schedule section and turn on Apply on a schedule.
  4. In Mode, choose Apply except during.
  5. In Time zone, check the zone. It defaults to the time zone in your profile, or to your browser’s time zone when your profile has none. Every time in the schedule is local to this zone.
  6. For a regular window, select Add weekly window. Tick the days, then enter Start and End. For the nightly example, tick every day and enter 22:00 to 07:00. Add a second weekly window for Saturday and Sunday from 00:00 to 24:00 to cover the weekend.
  7. For a one-off window, select Add one-off range and enter the start and end date and time.
  8. Read the Current state line. It shows what the rule does now and when that changes, for example “Inactive now, until Mon 07:00 (Australia/Sydney)”.
  9. Save the rule.

The schedule goes on the proxy rule itself. Rules are checked in order and the first match wins, so a rule placed below a proxy rule that matches * never runs, and a schedule on such a rule does nothing.

The Rules page shows a badge on each scheduled rule: Scheduled · Active now or Scheduled · Inactive now with the same summary as the Current state line, or Scheduled · Disabled for a disabled rule.

Some points from the break-glass runbook also apply to a scheduled switch:

  • While the proxy rule is skipped, rules below it can match paths that the proxy rule answered before. Check them before the first window.
  • The schedule stops the edge from forwarding requests. It does not stop the application, which still answers at its own address if that address is public.
  • Forms, search, login and editing that the application answers do not work during the window.

In the rules API, a schedule is the schedule field of a rule.

{
"schedule": {
"timezone": "Australia/Sydney",
"mode": "inactive_during",
"weekly": [
{ "days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], "start": "22:00", "end": "07:00" },
{ "days": ["sat", "sun"], "start": "00:00", "end": "24:00" }
],
"once": [
{ "start": "2026-12-03T18:00", "end": "2026-12-05T09:00" }
]
}
}
Field Meaning
timezone An IANA time zone name, for example Australia/Sydney, or exactly UTC
mode active_during (dashboard: “Apply only during”) or inactive_during (dashboard: “Apply except during”)
weekly Up to 50 weekly windows. Each has days (one or more of mon, tue, wed, thu, fri, sat, sun), start and end (HH:MM)
once Up to 50 one-off ranges. Each has start and end as YYYY-MM-DDTHH:MM, local to timezone and with no offset. end must be later than start

How the times work:

  • The times are wall-clock times in the rule’s time zone, so a window at 22:00 in Australia/Sydney starts at 22:00 Sydney time in summer and in winter.
  • A window includes its start and excludes its end. A window from 22:00 to 07:00 applies at 22:00 and no longer applies at 07:00.
  • In a weekly window, the days are the days the window starts. An end that is not later than the start runs into the next day, so 22:00 to 07:00 on fri ends at 07:00 on Saturday.
  • 24:00 is allowed as an end only, and means midnight at the end of the day.
  • A start equal to the end is a window of a whole 24 hours.
  • Daylight saving is handled. A time that the spring change skips never occurs, so a window that starts at a skipped time starts when the clocks go forward. A time that the autumn change repeats counts both times.

The schedule is always shown and edited in its own time zone, whatever your profile’s zone is.

A switch at the start or end of a window usually shows within about one to two minutes. The same applies after you save a schedule. A rule change takes about 15 seconds to reach the edge, and cached responses then expire within 60 seconds:

  • When a request matches the domains and URLs of a scheduled rule, inside or outside a window, the edge limits how long a shared cache (the CDN) can keep the response to 60 seconds. It changes the s-maxage value and the stale directives. The max-age that browsers use is unchanged.
  • A response that the CDN cached before you added the schedule keeps its old lifetime. Add the schedule at least one cache lifetime before its first window, or purge the affected paths after you save it.
  • If the origin sends no Cache-Control header, a page that is already cached can be served from the cache for up to 15 minutes after a switch. A cached page never reaches the origin, so a break-glass window still keeps that traffic away from the CMS.

Each response has the header quant-features: rule-schedule. A response for which the edge checked a scheduled rule also has quant-rule-schedule, with the value active when the rule applied, or inactive when it was skipped.

Test with a cache-busting query string, so the request misses the cache and the rules run again. The query string does not change which rule matches, because rules match on the path.

Terminal window
SITE=https://www.example.com
curl -sI "$SITE/?cb=$RANDOM" | grep -i "quant-rule-schedule\|quant-features"

For the break-glass example, quant-rule-schedule: inactive during the window means the proxy rule was skipped and the edge served the static copy. The headers that your CMS sends, such as x-generator on Drupal or x-powered-by from PHP, are gone too. Outside the window, the response has quant-rule-schedule: active and the CMS headers again.

  • Up to 50 weekly windows and up to 50 one-off ranges on each rule.
  • timezone must be an IANA name or exactly UTC. Offsets such as +10:00 are not accepted.
  • The API refuses an unknown time zone, a time that is not HH:MM, a weekly window with no days, a one-off range whose end is not later than its start, and more than 50 entries of either kind. It returns 422 and names the field.
  • The dashboard does not save a schedule that is turned on and has no windows.

The rules API accepts, checks and returns schedule on every rule type, from API specification version 4.37.0.

  • A PATCH without schedule keeps the stored schedule.
  • A PATCH with "schedule": null removes the schedule, and the rule applies at all times again.
Terminal window
API=https://dashboard.quantcdn.io/api/v2/organizations/{organization}/projects/{project}
curl -s -X PATCH -H "Authorization: Bearer $QUANT_API_TOKEN" -H "Content-Type: application/json" \
-d '{"schedule": null}' "$API/rules/proxy/{rule}"

On QuantGov, use https://dash.quantgov.cloud.