# Cloudflare Pages reads this file from the root of the deployed directory # (build/_headers once .gitea/workflows/build-and-publish.yaml copies it # in). It lives here, outside static/, so that `make clean` (which does # `rm -rf static/_*`) cannot delete it and so Docusaurus does not copy it # into every locale build directory (see the locale rules below for why # that would matter anyway). # Docusaurus content-hashed build output (webpack chunks, css, etc). The # filename changes whenever the content changes, so it is safe to cache # these for a long time and mark them immutable. /assets/* Cache-Control: public, max-age=31536000, immutable # docusaurus.config.js configures locales ["en-us", "zh-cn", "zh-tw"] with # "en-us" as the default. Docusaurus only serves the default locale at the # site root; every other locale gets a full copy of the build under a # // prefix (e.g. build/zh-cn, build/zh-tw), including its own # assets/img/images directories. Confirmed live: /zh-cn/ references # /zh-cn/assets/css/styles.a0cbb0c4.css, and without a rule matching that # path it is served with `cache-control: public, max-age=0, # must-revalidate` instead of the caching below. # # Use a `:locale` placeholder rather than listing "zh-cn" and "zh-tw" # explicitly, so this keeps working if a locale is added or removed later # without anyone remembering to update this file. Cloudflare Pages only # allows a single `*` splat per path, so the locale segment has to be a # named placeholder (`:locale`, matching exactly one path segment) rather # than a second splat; `/*/assets/*` is not a valid pattern. /:locale/assets/* Cache-Control: public, max-age=31536000, immutable # Files under static/img and static/images keep stable filenames and can be # replaced in place (same name, new content), so use a short, conservative # max-age instead of immutable caching. /img/* Cache-Control: public, max-age=86400 /:locale/img/* Cache-Control: public, max-age=86400 /images/* Cache-Control: public, max-age=86400 /:locale/images/* Cache-Control: public, max-age=86400