From 2ad61c91c6b4ab73265b32b64d88a9d81d8d6146 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Mon, 10 Aug 2026 16:18:14 +0900 Subject: [PATCH] 1.0: add missing cache control for static resources Signed-off-by: Kentaro Hayashi --- netlify.toml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/netlify.toml b/netlify.toml index e3424e43..94d2152f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -17,3 +17,64 @@ to = "/1.0/assets/:splat" status = 200 +# weekly cache (7 * 86400) +[[headers]] + for = "/images/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/1.0/images/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/0.12/images/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/assets/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/1.0/assets/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/0.12/assets/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/gitbook/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/1.0/gitbook/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +[[headers]] + for = "/0.12/gitbook/*" + [headers.values] + Cache-Control = "public, max-age=604800" + +# for custom theme +[[headers]] + for = "/styles/*" + [headers.values] + Cache-Control = "public, max-age=86400" + +[[headers]] + for = "/1.0/styles/*" + [headers.values] + Cache-Control = "public, max-age=86400" + +[[headers]] + for = "/0.12/styles/*" + [headers.values] + Cache-Control = "public, max-age=86400"