Add Condition and Cache Settings
A 4-step recipe with Fastly. We can help you get access.
Recipe · 4 steps
Add Condition and Cache Settings
with Fastly
Clone a version, add a condition and a conditional cache rule, then activate.
- Clone the supplied version into a new editable draft version.
- Create a cache condition on the cloned version.
- Create a cache settings rule bound to the new condition.
- Activate the cloned version so the condition and cache rule go live.
What you'll need to have ready
- apiToken: The Fastly API token used to authenticate requests.
- serviceId: The alphanumeric identifier of the service.
- versionId: The version number to clone.
- conditionName: A name for the condition.
- statement: The VCL boolean expression for the condition.
- cacheSettingsName: A name for the cache settings rule.
- ttl: The maximum cache lifetime in seconds.
For your developer
Arazzo workflow fastly:add-condition-and-cache-settings, 4 operations: cloneServiceVersion → createCondition → createCacheSettings → activateServiceVersion. Specs on APIs.io.