Skip to main content

Operating Edge

Turning Edge Off​

ScopeHowEffect
One propertySwitch off Enabled on the property's Edge settings.Allegro deletes the worker route and exclusion routes. Traffic goes straight to the origin.
One propertyDelete the {hostname}/* route in the Cloudflare dashboard.Same, immediately, without Allegro.
An organizationDelete the routes for each property in Cloudflare.Stops all edge traffic for that organization.
Updates onlySwitch off Update automatically, or set EDGE_AUTO_DEPLOY=false for the instance.Freezes workers at their current version. Workers keep serving traffic.
Removing routes needs auto deploy

Switching off Enabled removes routes only when the instance has EDGE_AUTO_DEPLOY on and the organization's Cloudflare account is connected. Otherwise, delete the routes in Cloudflare yourself.

There is no instance-wide switch that stops traffic. Disconnect on the organization's Allegro Edge settings and EDGE_AUTO_DEPLOY=false both leave deployed workers running. To take Edge out of the request path, remove the routes in Cloudflare.

Failure Behavior​

Edge fails open: when it can't make a decision, visitors get the origin page and the SDK runs interactions in the browser as it would without Edge.

FailureResponse
Evaluate times out (1.5 seconds), errors, or returns bad dataOrigin page, no edge actions. The SDK evaluates in the browser. x-allegro-edge: bypass.
The worker throws while transforming the pageThe untransformed origin page. x-allegro-edge: bypass.
The origin can't be reached502 with "Origin unavailable".
The worker is missing a required variableEvery request passes through. x-allegro-edge: passthrough.
Interaction preview linksEvaluate is skipped and the SDK handles the preview.

Failing open isn't configurable. During an Allegro outage, gated content is enforced only by the SDK in the browser, the same as on a site without Edge.

Caching​

The worker caches in two layers:

  1. Origin fetch. For anonymous, shareable requests the worker strips cookies and authorization from the origin request and lets Cloudflare cache the origin response.
  2. Rendered page. The rendered page is cached in Workers Cache, keyed by the URL and a hash of the render plan, which is the set of edge actions the decision produced. Visitors who get the same decision share one cached page. Tracking parameters such as utm_*, gclid, and fbclid are dropped from the cache key.

Cached pages live for the shorter of the origin's s-maxage/max-age and five minutes, and can be served stale for another 60 seconds while they refresh. Nothing is cached when the origin sends Set-Cookie, Cache-Control: private, no-store, or no-cache, or a Vary header other than Accept-Encoding.

The cache is skipped for WordPress previews, Allegro preview and debug links, and visitors with a WordPress login, password-protected post, or comment author cookie.

Invalidation​

There is no purge. Changes reach visitors as follows:

  • Interaction changes take effect on the next request. The decision is made on every request and a new render plan produces a new cache key.
  • Origin content changes appear when the cached page expires, within the TTL above. Lower the origin's s-maxage if edits need to show sooner.

The response sent to the visitor is always Cache-Control: private, no-store, so browsers and downstream caches never store an edge-rendered page.

Observability​

Response Headers​

HeaderValues
x-allegro-edge1: transformed with a decision. bypass: transformed without one (see Failure Behavior). passthrough: not handled, such as a non-HTML or non-GET request, an excluded path, or another host.
x-allegro-edge-cacheHIT or MISS from Workers Cache, or none when the cache was skipped. Absent on passthrough responses.

The outer CF-Cache-Status is removed from transformed responses; use x-allegro-edge-cache instead.

Page Markers​

A transformed page carries:

  • <meta name="allegro-edge" content="1"> at the start of <head>.
  • <script type="application/json" id="allegro-edge-decision"> before </body>, holding the decision the SDK picks up.
  • An HTML comment at the end of the document, for example <!-- allegro-edge status=1 cache=HIT matches=… rendered=… missed=none at=… -->.

Selector Misses​

When a template action's selector matches nothing on the page, the worker lists it under missed in the decision script and the trailing HTML comment. A selector the worker can't parse is logged as a warning in the worker's logs. Selector misses aren't reported to Allegro or shown in the dashboard; check the page source or the worker logs with wrangler tail.

A miss usually means the selector doesn't match the origin's markup, or matches markup that only exists after scripts run in the browser.

Tuning Variables​

The worker reads optional variables that Allegro doesn't set on automatic deploys. To change them, deploy by hand.

VariableDefaultDescription
EVALUATE_TIMEOUT_MS1500How long to wait for evaluate before failing open.
DEBUG_EVALUATE_TIMEOUT_MS5000The same, for debug sessions.
EDGE_CACHE_TTL300Maximum seconds a rendered page is cached.
IGNORE_PATHS(none)Extra path regular expressions to pass through, one per line.
BYPASS_COOKIES(none)Extra cookie name prefixes that skip the cache, one per line.
CACHE_IGNORE_PARAMS(none)Extra query parameters to drop from the cache key, one per line.