cloudflare
Manage DNS records for domains hosted on GoPanel using Cloudflare's API
|
Syntax
Setting Up Cloudflare API Integration with GoPanel
$ /go/cloudflare <Account ID> <Auth Email> <Auth Key> --setup
|
Examples
To integrate Cloudflare's API with GoPanel for managing DNS records
$ /go/cloudflare AccountID AuthEmail AuthKey --setup
Replace AccountID with your Cloudflare Account ID
Replace AuthEmail with your Cloudflare Auth Email
Replace AuthKey with your Cloudflare Auth Key
To migrate all DNS zone records from all domains in GoPanel to Cloudflare
$ /go/dns all
To migrate all DNS zone records from all domains in GoPanel to Cloudflare and Configuring Edge Cache TTL
$ /go/dns all --cache
Edge Cache TTL (Time to Live) determines how long Cloudflare's edge servers cache your content before checking the origin
server for updates. This is a crucial setting for optimizing performance and reducing origin server load.
Managing Edge Cache TTL via PHP Headers:
You can control Cloudflare's edge caching behavior directly from your PHP application by sending appropriate HTTP headers.
This gives you dynamic control over caching based on your application logic.
<?php
// Set a basic Cache-Control header (in seconds)
header("Cache-Control: public, max-age=3600"); // 1 hour caching
// For Cloudflare-specific caching (recommended)
header("Cache-Control: public, s-maxage=3600"); // s-maxage specifically targets CDNs
// For CSS/JS/images that rarely change
header("Cache-Control: public, max-age=31536000, immutable"); // 1 year
// For personalized or frequently updated content
header("Cache-Control: no-cache, max-age=0, must-revalidate");
// Or for slightly better performance:
header("Cache-Control: public, s-maxage=60, stale-while-revalidate=3600");
?>
To add an A record using Cloudflare's API
$ /go/cloudflare gopanel.org adda 11.22.33.44 --proxy off
To delete A ecord using Cloudflare's API
$ /go/cloudflare gopanel.org deletea 11.22.33.44
|
Related GoPanel commands
dns
-
Add your domain to Cloudflare and editing the DNS zone
proxy
-
Change Cloudflare's proxy setting
purge
-
Delet Cloudflare Edge Cache (Purge Everything)
|
At Your Service
Our team is on hand 24/7 to not only solve technical issues, but to offer the guidance and technical support you need to succeed online. Give us a ring.
|
|
|
© 2020 - 2025 GoPanel Inc., all rights reserved.
|
|