Preconnect to Nitro client URL for faster client page load

This commit is contained in:
openhands committed 2026-07-09 18:35:18 +02:00
1 parent da505ae643
commit cfb36e8007
1 file changed
+4
+4
View File
@@ -62,6 +62,7 @@ export default async function RootLayout({ children }: { children: ReactNode })
const headersList = await headers();
const pathname = headersList.get("x-pathname") || headersList.get("next-url") || "";
const isClient = pathname === "/client" || pathname.startsWith("/client/");
const nitroUrl = await siteSettings.get("nitro_client_url", "");
return (
<html lang={locale} className={`app ${nunito.variable} ${pixelFont.variable}`}>
<head>
@@ -69,6 +70,9 @@ export default async function RootLayout({ children }: { children: ReactNode })
<script src="/scripts/theme-init.js" />
<link rel="preconnect" href="https://www.habbo.com" />
<link rel="dns-prefetch" href="https://www.habbo.com" />
{nitroUrl ? (
<link rel="preconnect" href={new URL(nitroUrl).origin} />
) : null}
</head>
<body
className="flex min-h-screen flex-col site-bg"