API preconnect

Performance tip

API preconnect is recommended for improved request timings. To enable it, place the preconnect directive as early as possible in your head tag:

<html>
<head>
  <link rel="preconnect" href="https://fpcdn.io">
  <link rel="preconnect" href="https://tls-use1.fpapi.io">
  <link rel="preconnect" href="https://api.fpjs.io">
  ... styles, js etc
<html>
<head>
  <link rel="preconnect" href="https://fpnpmcdn.net">
  <link rel="preconnect" href="https://tls-use1.fpapi.io">
  <link rel="preconnect" href="https://api.fpjs.io">
  ... styles, js etc

Note that you always need to preconnect to tls-use1.fpapi.io and api.fpjs.io.

  • If you're using the EU API, use this preconnect URLs: https://tls-eun1.fpapi.io and https://eu.api.fpjs.io.
  • If you're using the Mumbai API, use this preconnect URLs: https://tls-aps1.fpapi.io and https://ap.api.fpjs.io
  • If you're using subdomain integration, use your subdomain in the preconnect, instead of https://api.fpjs.io

Example with subdomain integration enabled on https://fp.mydomain.com:

<html>
<head>
  <!-- only if you load the script from the CDN -->
  <link rel="preconnect" href="https://fpcdn.io">
  <link rel="preconnect" href="https://tls-use1.fpapi.io">
  <link rel="preconnect" href="https://fp.mydomain.com">

Did this page help you?