Files
LuPhoto/packaging/cloudflare.md
T
2026-11-04 04:58:48 -08:00

1.1 KiB

Cloudflare

Run the site behind a Cloudflare Tunnel (cloudflared.yml in this folder). In serve mode the tunnel points at LuPhoto on 127.0.0.1:8080. In export mode it points at Caddy or nginx; give that web server a plain HTTP listener on 127.0.0.1:8080 for the tunnel, for example http://photos.luciochen.com:8080 in the Caddyfile, or listen 127.0.0.1:8080; in nginx.

Cache rules (Caching → Cache Rules), in this order:

  1. Tiles, OG images and assets: when the URI path starts with /t/, /og/ or /assets/, set Eligible for cache, Edge TTL 1 month (or "use cache-control header"), Browser TTL "respect origin". Their names are content-hashed, so they never change.
  2. Everything else (HTML, /a/*, index.<build>.json): Edge TTL 1 minute or "respect origin" (max-age=60). Manifests are named after the build, so a new build needs no purge.

Keep "Cache by device type" and query-string variations off. Hotlink protection is done by LuPhoto, Caddy or nginx on /t/*; Cloudflare's own Hotlink Protection can stay off, or be enabled for the same hostname.