Articles on: Technical Support

Using WP Compress with Cloudflare

Using WP Compress with Cloudflare



You can use both WP Compress and Cloudflare together! 🎉

We simply recommend not doubling up on settings (with Cloudflare or elsewhere) but you can toggle on/off any settings in our portal.

Make sure hotlinking protection is off so that we can download the images, but other than that you should be all set right out of the box!

If you're having trouble with critical css generation or image optimization, please whitelist the following user agent in Cloudflare:

Mozilla/5.0 (compatible; Compress-API/2.0.0; +https://wpcompress.com)


If your unsure how to do that in Cloudflare, you can follow these instructions:




Log in to your Cloudflare account at https://dash.cloudflare.com/.
Select the website for which you want to whitelist the user agent from the list of websites on the dashboard.
Click on the "Firewall" icon in the top menu to access the Firewall settings.
In the Firewall menu, click on the "Tools" tab.
Scroll down to the "User Agent Blocking" section and click on "Manage User Agents."
You will see a list of blocked user agents. Click on the "Create User Agent Rule" button.
In the "Expression" field, enter the user agent that you want to whitelist. For example, if you want to whitelist the user agent "MyUserAgent," enter "MyUserAgent" in the field.
Choose the action for the rule. To whitelist the user agent, select "SKIP" from the dropdown menu.
Skip all the remaining checkboxes to assure it's bypassing the WAF and communicating with our API.
Click on the "Save" button to create the rule and whitelist the user agent.

Cloudflare will now allow requests from the whitelisted user agent. Make sure to enter the exact user agent string you want to whitelist, as Cloudflare matches it exactly when applying the rule.


Custom CDN Domains with Cloudflare



If you're using Cloudflare DNS for a Custom CNAME please view this article 🙌🏼

Updated on: 06/13/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!