Dynamic Lead FormsEmbedding
Optimize Loading Speed
Optimize Surface Forms loading speed for better performance
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">Replace REPLACE ME WITH FORM URL with a Surface Form URL.
If the form uses a custom domain, replace forms.withsurface.com in the connection hints with your verified domain. See Use the Surface Tag with a Custom Domain.
Explanation
- dns-prefetch → Resolves the domain early to skip DNS lookup delays.
- preconnect → Prepares the TCP + TLS handshake so the browser is ready to request assets immediately.
- 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.
Project Settings → Custom Code → Head Code.