From 64a3fad37369b605c1e496c94d610a1109c4d5dd Mon Sep 17 00:00:00 2001 From: goodroot <9484709+goodroot@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:32:24 -0800 Subject: [PATCH] try custom headers --- custom-headers/_previewHeaders | 18 ++++++++++++++++++ custom-headers/_productionHeaders | 14 ++++++++++++++ netlify.toml | 6 ++++++ 3 files changed, 38 insertions(+) create mode 100644 custom-headers/_previewHeaders create mode 100644 custom-headers/_productionHeaders diff --git a/custom-headers/_previewHeaders b/custom-headers/_previewHeaders new file mode 100644 index 00000000..31df2c1d --- /dev/null +++ b/custom-headers/_previewHeaders @@ -0,0 +1,18 @@ +/* + X-Frame-Options: SAMEORIGIN + X-XSS-Protection: 0 + X-Content-Type-Options: nosniff + Content-Security-Policy: frame-src 'self' app.netlify.com *.demo.questdb.io *.questdb.io www.youtube.com www.slideshare.net forms.hsforms.com; + +/docs/* + Location: /:splat + Status: 200 + +/static/* + Cache-Control: public, max-age=31536000, immutable + +*.js + Cache-Control: public, max-age=31536000, immutable + +*.css + Cache-Control: public, max-age=31536000, immutable \ No newline at end of file diff --git a/custom-headers/_productionHeaders b/custom-headers/_productionHeaders new file mode 100644 index 00000000..908d835c --- /dev/null +++ b/custom-headers/_productionHeaders @@ -0,0 +1,14 @@ +/* + X-Frame-Options: SAMEORIGIN + X-XSS-Protection: 0 + X-Content-Type-Options: nosniff + Content-Security-Policy: frame-src 'self' app.netlify.com *.demo.questdb.io *.questdb.io www.youtube.com www.slideshare.net forms.hsforms.com; + +/static/* + Cache-Control: public, max-age=31536000, immutable + +*.js + Cache-Control: public, max-age=31536000, immutable + +*.css + Cache-Control: public, max-age=31536000, immutable \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index a4d42b8c..6acc2eef 100644 --- a/netlify.toml +++ b/netlify.toml @@ -665,3 +665,9 @@ to = "/:splat" status = 200 force = true conditions = {Context = "deploy-preview"} + +[context.production] +command = "npm run build && cp ./custom-headers/_productionHeaders ./build/_headers" + +[context.deploy-preview] +command = "npm run build && cp ./custom-headers/_previewHeaders ./build/_headers"