From ec98c6c9751f564712d050e4f907f8c7b8fe7ea0 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 27 Apr 2022 09:51:59 -0700 Subject: [PATCH 1/3] Set a cache control header on font files --- vercel.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 9d75cd60a..1462f17ca 100644 --- a/vercel.json +++ b/vercel.json @@ -1,3 +1,14 @@ { - "regions": ["sfo"] + "regions": ["sfo"], + "headers": [ + { + "source": "/static/fonts/.*", + "headers" : [ + { + "key" : "Cache-Control", + "value" : "public,max-age=36000" + } + ] + } + ] } From 01f89950367665ffaba6eee9ee50a54b45c8353d Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 27 Apr 2022 10:00:44 -0700 Subject: [PATCH 2/3] Correct path to regex syntax --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 1462f17ca..56cc71c17 100644 --- a/vercel.json +++ b/vercel.json @@ -2,7 +2,7 @@ "regions": ["sfo"], "headers": [ { - "source": "/static/fonts/.*", + "source": "/static/fonts/(.*)", "headers" : [ { "key" : "Cache-Control", From a80d5471c415383d96323ffecef9e78bda31cd85 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 27 Apr 2022 10:59:50 -0700 Subject: [PATCH 3/3] Longer max age on cache control header for fonts --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 56cc71c17..39bd91a18 100644 --- a/vercel.json +++ b/vercel.json @@ -6,7 +6,7 @@ "headers" : [ { "key" : "Cache-Control", - "value" : "public,max-age=36000" + "value" : "public,max-age=31536000" } ] }