Menu

Optimize embed

Surface forms load fast already. To cut the wait further, tell the browser to prepare its connection to forms.withsurface.com ahead of time, so the form is ready the moment it is triggered.

How to optimize

Add the following <link> tags inside the <head> of your site:

<!-- Speed up connections to forms.withsurface.com by performing early DNS resolution and TCP handshake -->
<link rel="dns-prefetch" href="https://forms.withsurface.com">
<link rel="preconnect" href="https://forms.withsurface.com" crossorigin>

<!--  Fetch the form in advance, so it's ready when a user opens it. -->
<link rel="prefetch" href="REPLACE ME WITH FORM URL" as="document">

Explanation

  1. dns-prefetch → Resolves the domain early to skip DNS lookup delays.
  2. preconnect → Prepares the TCP + TLS handshake so the browser is ready to request assets immediately.
  3. prefetch → Fetches the form in advance, so it's ready when a user opens it.

Where to paste it

These are <head> tags, so they go wherever your platform puts head code.

Webflow

Project Settings → Custom Code → Head Code.

Framer

Project Settings → Custom Code → Start of <head> tag.

WordPress

WPCode → Code Snippets → Header & Footer → Header.

Next.js

app/layout.tsx, inside the <head> of the root layout.

React

public/index.html, inside <head>.

Unbounce

Bottom toolbar → JavaScript → Add New JavaScript, placement "Head".

HTML

Inside <head>, on every page that shows the form.