mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
perf: improve LCP — move font loading to HTML, defer logo preload
- Move Google Fonts from CSS @import (render-blocking) to <link> in index.html with preconnect for earlier discovery - Remove @import from globals.css — browser no longer waits for CSS parse -> @import fetch -> font CSS parse before first paint - Defer initLogoPreload() to requestIdleCallback so logo fetch doesn't compete with critical resources during page load
This commit is contained in:
@@ -92,8 +92,12 @@ if (!alreadyInitialized) {
|
||||
}
|
||||
}
|
||||
|
||||
// Preload logo from cache immediately on page load
|
||||
initLogoPreload();
|
||||
// Preload logo from cache — defer to idle time so it doesn't compete with LCP
|
||||
if ('requestIdleCallback' in window) {
|
||||
requestIdleCallback(() => initLogoPreload());
|
||||
} else {
|
||||
setTimeout(initLogoPreload, 100);
|
||||
}
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
|
||||
Reference in New Issue
Block a user