From 0fe899d83a93f2f0de902735a90f511e89c2684b Mon Sep 17 00:00:00 2001 From: mat ess Date: Fri, 21 Oct 2022 00:38:07 -0400 Subject: [PATCH] Add per asset caching --- netlify.toml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/netlify.toml b/netlify.toml index a26ab30..ca2f16d 100644 --- a/netlify.toml +++ b/netlify.toml @@ -12,10 +12,38 @@ to = "https://mat.services/:splat" force = true +# per asset caching + +[[headers]] + for = "/font/*" + [headers.values] + # a year + Cache-Control = "public, max-age=31536000" + +[[headers]] + for = "/image/*" + [headers.values] + # a month + Cache-Control = "public, max-age=2592000" + +[[headers]] + for = "/*.webp" + [headers.values] + # a month + Cache-Control = "public, max-age=2592000" + +[[headers]] + for = "/style/*" + [headers.values] + # a week + Cache-Control = "public, max-age=604800" + [[headers]] for = "/*" [headers.values] + # baseline cache, one hour + Cache-Control = "public, max-age=3600" # disable FLoC tracking Permissions-Policy = "interest-cohort=()" # enable HSTS