We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ef24d9 commit f640931Copy full SHA for f640931
apps/svelte.dev/src/hooks.server.js
@@ -21,7 +21,15 @@ export async function handle({ event, resolve }) {
21
}
22
23
const response = await resolve(event, {
24
- preload: ({ type }) => type === 'js' || type === 'css' || type === 'font'
+ preload: ({ type, path }) => {
25
+ if (type === 'font') {
26
+ // only preload header font, everything else is lower priority,
27
+ // otherwise it causes congestion that messes up LCP
28
+ return path.includes('dm-serif-display-latin-400-normal') && path.endsWith('.woff2');
29
+ }
30
+
31
+ return true;
32
33
});
34
35
return response;
0 commit comments