Skip to content

Commit 9a13624

Browse files
committed
feat: preload and cache font
1 parent 358f7bb commit 9a13624

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

pages/_document.js

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ class MyDocument extends Document {
1010
return (
1111
<Html>
1212
<Head>
13+
<link
14+
rel='preload'
15+
href='/fonts/inter-var-latin.woff2'
16+
as='font'
17+
type='font/woff2'
18+
crossOrigin='anonymous'
19+
/>
1320
<link
1421
rel='apple-touch-icon'
1522
sizes='57x57'

vercel.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"headers": [
3+
{
4+
"source": "/fonts/inter-var-latin.woff2",
5+
"headers": [
6+
{
7+
"key": "Cache-Control",
8+
"value": "public, max-age=31536000, immutable"
9+
}
10+
]
11+
}
12+
]
13+
}

0 commit comments

Comments
 (0)