diff --git a/apps/web/app/SpeculationRules.tsx b/apps/web/app/SpeculationRules.tsx
new file mode 100644
index 0000000000..0a14e62d69
--- /dev/null
+++ b/apps/web/app/SpeculationRules.tsx
@@ -0,0 +1,34 @@
+import Script from "next/script";
+
+export function SpeculationRules({
+ prefetchPathsOnHover = [],
+ prerenderPathsOnHover = [],
+}: {
+ prefetchPathsOnHover?: string[];
+ prerenderPathsOnHover?: string[];
+}) {
+ const speculationRules = {
+ prefetch: [
+ {
+ urls: prefetchPathsOnHover,
+ eagerness: "moderate",
+ },
+ ],
+ prerender: [
+ {
+ urls: prerenderPathsOnHover,
+ eagerness: "moderate",
+ },
+ ],
+ };
+
+ return (
+
+ );
+}
diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx
index b9bf0ba237..d344b0a5b8 100644
--- a/apps/web/app/layout.tsx
+++ b/apps/web/app/layout.tsx
@@ -10,6 +10,7 @@ import { IconSprites } from "@calcom/ui";
import { prepareRootMetadata } from "@lib/metadata";
import "../styles/globals.css";
+import { SpeculationRules } from "./SpeculationRules";
import { Providers } from "./providers";
const interFont = Inter({ subsets: ["latin"], variable: "--font-inter", preload: true, display: "swap" });
@@ -145,6 +146,19 @@ export default async function RootLayout({ children }: { children: React.ReactNo
}}
/>
)}
+
{children}