::meta ::owner Experimental

The ::meta suffix returns a digest of a deployment that changes on every deploy, and ::owner tells a signed-in visitor whether they own the route. A third form, ?m=uo, answers the ownership question as plain text.

Syntax

plain
https://name.rt.ht/::meta
https://name.rt.ht/docs/::meta
https://name.rt.ht/::owner
https://name.rt.ht/?m=uo

::meta and ::owner go at the end of <route path>/. A path such as /docs::meta addresses the root route, so for the route name/docs write /docs/::meta.

Parameters

::meta

The path is <route path>/::meta. It answers after RTEdge.net has read the deployment and after the edge:user check, so a visitor who is not permitted gets the 401 or 403 page.

::owner

The path is <route path>/::owner. It answers before every access gate, with no edge:user check. RTEdge.net reads the route metadata only when the visitor is signed in.

?m=uo

The query parameter m with the value uo, on any path of a route that is not a worker, index or ?? URL. Files count: /nav.js?m=uo works. It answers after the deployment is read, but before the check that the route exists and before edge:user.

Response

RequestStatusBody
::meta200{ "digest": { "hash": "<64 hex characters>" } }, pretty-printed.
::meta on a route that is not deployed404null
::owner, signed in200{ "<viewer email>": true } when the viewer owns the route, otherwise { "<viewer email>": false }.
::owner, signed out200null
?m=uo, signed in200true or false, as text.
?m=uo, signed out200null, as text.

::meta and ::owner answer with Content-Type: application/json;charset=utf-8 and Cache-Control: no-store. ?m=uo answers with Content-Type: text/plain;charset=UTF-8 and sets no Cache-Control.

The digest

hash is a SHA-256 hex digest that RTEdge.net computes at each deploy. It changes on every deploy, even when the content is identical, so it detects a new deploy but does not describe the content. Root pages and files send the deploy time as the deploy response header, an ISO timestamp.

Freshness

A request with Cache-Control: no-cache or max-age=0, which is what fetch(…, { cache: 'no-store' }), 'no-cache' and 'reload' send, and a document navigation referred by https://rtcode.io/, read the owner's fresh copy of the deployment. That copy lasts about 90 seconds after a deploy. Other requests read replicated storage, which is eventually consistent.

For routes that may not be deployed yet, prefer ::owner, which reports false for a route that does not exist.

Access

Anyone can ask. ::meta stands behind the view gate, so edge:user applies to it. ::owner and ?m=uo answer before that gate and report only on the visitor who asks. See Security and access model.

Examples

Reload when a new version is deployed

html
<script type=module>
  const hash  = () => fetch('::meta', { cache: 'no-store' }).then(r => r.ok ? r.json() : null).then(j => j?.digest?.hash)
  const first = await hash()
  setInterval(async () => { const h = await hash(); h && h !== first && location.reload() }, 30e3)
</script>

The cache: 'no-store' option sends Cache-Control: no-cache, so the router reads the fresh copy for about 90 seconds after a deploy. The hash changes on every deploy. A 401 or 403 on an edge:user route is ignored, because r.ok is false. The playground does not implement ::meta, so the check stays idle there.

Show an edit link only to the route owner

html
<a id=edit href=? hidden>Edit this page</a>
<script type=module>
  const me = await fetch('::su').then(r => r.json())
  const own = me !== null && (await fetch('::owner').then(r => r.json()))?.[me] === true
  edit.hidden = !own
</script>

::su gives the signed-in email, and ::owner maps that email to true when it owns the route.

Ask with a query parameter

html
<a id=change href=? hidden>Change this page</a>
<script type=module>
  change.hidden = await fetch('?m=uo').then(r => r.text()) !== 'true'
</script>

The relative ? opens the source page, and the relative ?m=uo asks the router about ownership. The answer is null, true or false as text.

Specifications

Not part of any specification. ::meta, ::owner and ?m=uo are an RTEdge.net feature.

Specification
The JSON Data Interchange Format (RFC 8259)

Availability

FeaturePlaygroundRTEdge.netNotes
::meta ExperimentalNoYesA feature of the RTEdge.net router. The playground does not implement it.
::owner ExperimentalNoYesThe playground does not implement it.
?m=uo ExperimentalNoYesThe playground does not implement it.

See also