# Cloudflare Pages header rules for the project site.
#
# The source snapshot lives at a STABLE filename (archilyzer-source.tar.gz), so
# a new snapshot replaces the bytes behind a URL that has already been cached.
# A short, revalidating lifetime keeps the edge from serving yesterday's build
# for hours while still absorbing a burst of downloads.
/downloads/*
  Cache-Control: public, max-age=300, must-revalidate

# The published source (`archilyzer source publish`, common/publish/source.ts).
/source/manifest.json
  Cache-Control: public, max-age=300, must-revalidate
/source/archilyzer.git/*
  Cache-Control: public, max-age=300, must-revalidate
# The raw tree is PLAIN TEXT whatever the extension: wrangler's mime map would
# send .ts as video/mp2t, .mjs as application/javascript, .md as text/markdown
# and .html as a page on this origin.
/source/tree/*
  Content-Type: text/plain; charset=utf-8
  X-Content-Type-Options: nosniff
  X-Robots-Tag: noindex
  Cache-Control: public, max-age=300, must-revalidate
# ...except the generated directory indexes and the binary files. Every rule
# that matches applies, in file order, and a header a LATER rule sets again is
# APPENDED to the earlier value ("text/plain; …, text/html; …" — wrangler's
# attachHeaders, the Pages asset server's code). So each override first
# detaches the tree's Content-Type with `! Content-Type`, then sets its own.
/source/tree/
  ! Content-Type
  Content-Type: text/html; charset=utf-8
/source/tree/*/
  ! Content-Type
  Content-Type: text/html; charset=utf-8
/source/tree/*.ttf
  ! Content-Type
  Content-Type: font/ttf
/source/tree/*.m4a
  ! Content-Type
  Content-Type: audio/mp4
/source/tree/*.zip
  ! Content-Type
  Content-Type: application/zip
/source/tree/*.onnx
  ! Content-Type
  Content-Type: application/octet-stream
/source/tree/*.svg
  ! Content-Type
  Content-Type: image/svg+xml
  Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'
# The history pages (stagit, sourceHistory.ts) are HTML by extension, and kept
# out of search indexes like the raw tree (ruled, release 15 slice SG).
/source/git/*
  X-Robots-Tag: noindex
