Hi @temovision,
Thanks for reaching out! You can exclude your ads.txt file from being cached by following these steps:
- Go to Super Page Cache → Settings → WP Cloudflare
- Navigate to the General tab
- Find the “Prevent the following URIs to be cached” textarea
- Add the following on its own line: <code class=””>/ads.txt
- Click Save and then Purge the Cache
That’s it! Your ads.txt file will now be bypassed by the cache and served in real-time directly from your server.
To confirm it’s working, you can check the response headers for https://yourdomain.com/ads.txt — you should see:
X-WP-CF-Super-Cache-Disabled-Reason: Excluded URL - /ads.txt
If you run into any issues or have further questions, feel free to reach out — happy to help!
Thank you. Did it but the rule only took effect after I disabled and enabled cloudflare cdn and caching setting for the rule to be written on Cloudflare.
Hi @temovision,
You are correct, and that is expected behavior. When you add a URL to the Excluded URLs list, the plugin needs to rebuild and update the Cache Rule on Cloudflare’s side. Simply saving the setting updates the plugin’s configuration locally, but the change only fully propagates to Cloudflare when the Cache Rule is rewritten.
The proper way to trigger this without having to disable/re-enable the CDN is use the “Purge Cache” button under the plugin settings.
Oh great. Thanks again for the insight.