NitroPack and Cloudflare

NitroPack is compatible with Cloudflare, but you need to apply a few settings.

Step 1 - Linking NitroPack with Cloudflare

Do this if you want to synchronize the NitroPack cache and the Cloudflare cache:

1. Go to https://nitropack.io and log in.

2. Go to https://nitropack.io/user/settings and go to the section Integrations.

3. Enable the Cloudflare option and insert your Cloudflare account e-mail address and Cloudflare Global API Key:

cloudflare_integration.png

4. Finally, click Save

Important Note: 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

 

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.

Was this article helpful?
27 out of 34 found this helpful

Comments

0 comments

Article is closed for comments.