Early Hints for SaaS
Early Hints allows the browser to begin loading resources while the origin server is compiling the full response. This improves webpage’s loading speed for the end user. As a SaaS provider, you may prioritize speed for some of your custom hostnames. Using custom metadata, you can enable Early Hints per custom hostname.
Before you can employ Early Hints for SaaS, you need to create a custom hostname. Review Get Started with Cloudflare for SaaS if you have not already done so.
-
Locate your zone ID, available in the Cloudflare dashboard.
-
Locate your Authentication Key by selecting My Profile > API tokens > Global API Key.
-
If you are creating a new custom hostname, make an API call such as the example below, specifying
"early_hints": "on"
:
- For an existing custom hostname, locate the
id
of that hostname via aGET
call:
- Then make an API call such as the example below, specifying
"early_hints": "on"
:
Currently, all options within settings
are required in order to prevent those options from being set to default. You can pull the current settings state prior to updating Early Hints by leveraging the output that returns the id
for the hostname.