Before you begin
- Complete your first API request; the Bash examples use the same credential variables.
- Have permission to read and modify the distribution’s cache configuration.
- Install
jqfor JSON editing and use curl 7.76 or later for--fail-with-body. - Choose an existing distribution in the key’s project. The examples use ID
73; replace it in every URL. - Confirm edge caching is already enabled with
controlled_by: "cdn". This example does not change who controls freshness.
1. Read and save the current configuration
Run these commands in a private working directory. The files contain distribution settings, not API credentials.cache-before.json contains the cache configuration rather than an error document. Keep the original file for comparison and rollback.
2. Prepare the change
This command checks the required cache mode before changing the TTL:jq fails. A successful diff comparison with changes exits with code 1; review the output and confirm that the TTL is the only intended change. Formatting may also differ.
3. Submit the full document
4. Read back and test delivery
Repeat the GET request from step 1 with--output cache-verified.json. Compare its edge_cache fields with the intended state, then request a representative public file through the distribution.
The saved configuration verifies the control-plane change. Inspect actual responses and request logs to verify delivery behavior.
Recover from a failed or unwanted change
Restoring the saved document replaces all settings in that configuration area. Check for changes made by other operators before restoring it. The API does not document a general conditional-write or idempotency-key mechanism.
See request conventions for other configuration areas and caching for the meaning of each control.