Tempusxr Français
Menu
  1. Docs
  2. Tools

Host your scene

A scene is a folder of files: the scene.json, the target files, and the models, pictures, videos and sounds it names. Put the folder on any static host (Vercel, Netlify, Cloudflare Pages, GitHub Pages or R2) and open it with loadScene('https://your-host/scene.json') or tempusxr-scene="src: https://your-host/scene.json".

The files

The headers

WhatRuleWhy
Files with a hash in the nameCache-Control: public, max-age=31536000, immutableThey never change: the phone keeps them.
scene.jsonCache-Control: public, max-age=60, stale-while-revalidate=600An update shows within a minute.
EverythingAccess-Control-Allow-Origin: *, Cross-Origin-Resource-Policy: cross-originWebGL refuses a texture or a video from another address without them.
EverythingAccept-Ranges: bytesVideos start before they are fully loaded.

Most hosts send open CORS headers for static files by default; check yours if a picture or a video does not show. On Vercel, add the rules to vercel.json under headers.

Check it

Open the page on a phone with ?test in the address: the Test console lists each file the scene loads and any that fails. A scene that is not valid lists every problem with its place in the file.