1. Navigate to the pages/_document.tsx file.
  2. Add the following <link> tags in the Start of <head> tag section.
// pages/_document.tsx
import { Html, Head, Main, NextScript } from 'next/document'

export default function Document() {
  return (
    <Html lang="en">
      <Head>
        {/* Speed up connections to forms.withsurface.com */}
        <link rel="dns-prefetch" href="https://forms.withsurface.com" />
        <link rel="preconnect" href="https://forms.withsurface.com" crossOrigin="" />

        {/* Prefetch a form in advance */}
        <link
          rel="prefetch"
          href="REPLACE ME WITH FORM URL"
          as="document"
        />
      </Head>
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  )
}
Replace REPLACE ME WITH FORM URL with a Surface Form URL.