How to Set CloudFlare into Development Mode

Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site. This will bypass CloudFlare’s accelerated cache and slow down your site, but is useful if you are making changes to cacheable content (like images, css, or JavaScript) and would like to see those changes right away. Once entered, development mode will last for 3 hours and then automatically toggle off.

Run the following command to set CloudFlare into Development Mode (disabling cache) for the next 3 hours:

curl -X PATCH “https://api.cloudflare.com/client/v4/zones/yourzoneid/settings/development_mode” \
-H “X-Auth-Email: your@email.com” \
-H “X-Auth-Key: yourglobalapikey” \
-H “Content-Type: application/json” \
–data ‘{“value”:”on”}’

where:
yourzoneid is your CloudFlare’s zone ID
your@email.com is the email address used to login to CloudFlare
yourglobalapikey is your CloudFlare’s Global API key

You should see the response similar to the following:

{“result”:{“id”:”development_mode”,”value”:”on”,”modified_on”:”2016-07-29T03:12:44.569389Z”,”time_remaining”:10800,”editable”:true},”success”:true,”errors”:[],”messages”:[]}

P.S.
To find out your CloudFlare’s Zone ID, please see my previous post here.

Reference:
https://api.cloudflare.com/#zone-settings-change-development-mode-setting

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s