If you use Cloudflare, you must configure API access, so NitroPack can sync both caches and ensure the best possible performance. You can do that by following this quick process:
Step 1 - Linking NitroPack with Cloudflare
1. Log into NitroPack’s app and go to “Integrations”.
2. On the next screen, select "View Settings" in the Cloudflare widget.
3. Insert your Cloudflare account e-mail address and Cloudflare Global API Key.
To find your correct API key, follow the instructions here: https://developers.cloudflare.com/fundamentals/api/get-started/keys/
You can also find the API keys in your Cloudflare dashboard:
https://dash.cloudflare.com/profile/api-tokens
4. After filling in your Cloudflare credentials, the "Save" button will become active, allowing you to save your settings and complete the process.
Step 2 - Disable Mirage & Rocket Loader™
Once you connect NitroPack to Cloudflare, NitroPack will automatically disable the features Mirage and Rocket Loader™ to ensure everything is working smoothly. Mirage and Rocket Loader™ must remain disabled, as these are features that clash with NitroPack.
To disable them manually:
1. Go to your Cloudflare dashboard: https://dash.cloudflare.com/
2. Select your website, and go to Speed > Optimization Disable Mirage Disable Rocket Loader™
Step 3 - Modify Page Rules
If you don't have any Page Rules configured in Cloudflare, skip this step.
In case you have any existing Cloudflare Page Rules, follow the instructions here to configure them.
To find the Cloudflare Page Rules:
1. Go to your Cloudflare dashboard: https://dash.cloudflare.com/
2. Find Page Rules in the main menu
Ensure all your Page Rules meet the criteria below:
Edit Edge Cache TTL rules
In all Page Rules that contain Edge Cache TTL, remove Edge Cache TTL, or set Edge Cache TTL to 0.
Remove Rocket Loader™ rules
Remove all Page Rules that enable Rocket Loader™
Remove Mirage rules
Remove all Page Rules that enable Mirage
Important Note for Automatic Platform Optimization (APO) Users
NitroPack is compatible with Cloudflare's APO service. If you've gone through the steps above, NitroPack and APO should work fine automatically.
In case you wish to set up Cloudflare's APO, check out our article:
However, please note that when both services are working simultaneously, it might take longer for cache purges to produce an effect. That's why content updates may not appear instantly on your site.
For more details about the differences between NitroPack and Cloudflare's APO, please refer to this article.
📌 If you need any assistance or have questions, you can always reach out to our support team at [email protected] or via this link: https://support.nitropack.io