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://cdn.jsdelivr.net">
  <link rel="preconnect" href="https://api.sjpf.io">
  <link rel="preconnect" href="https://api.fpjs.io">
  ... styles, js etc

Note that you always need to preconnect to api.sjpf.io and api.fpjs.io. If you're using the CDN version of the script, you also need to preconnect to cdn.jsdelivr.net or whatever CDN you use.

If you're using the EU API, use this preconnect URL: https://eu.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://cdn.jsdelivr.net">
  <link rel="preconnect" href="https://api.sjpf.io">
  <link rel="preconnect" href="https://fp.mydomain.com">

 

Did this page help you?