younifyd
Menu

Update Cache Rule

Update a cache rule.

PATCH/organizations/{organizationId}/zones/{zoneId}/cache/rules/{ruleId}

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Update Cache Rule action (under Zones (Data API)).
  3. Fill in the fields below, then reference the result from later steps as {{updateCacheRule.response.data}}.

Request

Path parameters

ruleIdstringrequired
zoneIdstringrequired
organizationIdstringrequired

An identifier for the organization the request is being made by

Request body

Enter the body as JSON in the step's Body field.

descriptionstring

A description of what the cache rule does.

expressionstring

The expression that defines when this cache rule applies.

actionstring

The action to take (currently only supports "cache").

excludeQueryStringsarray<string>

List of query string parameters to exclude from the cache key.

ignoreQueryStringsOrderboolean

Specifies whether the order of query string parameters in the cache key is ignored.

respectStrongEtagsboolean

Specifies whether strong ETags are respected.

enabledboolean

Specifies whether the rule is enabled.

positionobject

Used to specify the position of a rule.

beforestring

Insert the current rule before this ruleId.

afterstring

Insert the current rule after this ruleId.

json
{
  "description": "Cache static assets on product pages.",
  "expression": "(http.request.uri.path matches \"^/product/.*\")",
  "action": "cache",
  "excludeQueryStrings": [
    "gclid",
    "utm_campaign"
  ],
  "ignoreQueryStringsOrder": true,
  "respectStrongEtags": false,
  "enabled": true,
  "position": {
    "before": "2c0fc9fa937b11eaa1b71c4d701ab86e",
    "after": "2c0fc9fa937b11eaa1b71c4d701ab86e"
  }
}

Response

Returns 200 with an object. Read it in later steps with {{updateCacheRule.response.data.<field>}}.

dataarray<object>
ruleIdstringrequired

The unique identifier for the cache rule.

descriptionstringrequired

A description of what the cache rule does.

expressionstringrequired

The expression that defines when this cache rule applies.

actionstringrequired

The action to take ("cache" to enable caching, "bypass" to bypass cache).

excludeQueryStringsarray<string>

List of query string parameters to exclude from the cache key.

ignoreQueryStringsOrderboolean

Specifies whether the order of query string parameters in the cache key is ignored.

respectStrongEtagsboolean

Specifies whether strong ETags are respected.

lastUpdatedstring (date-time)

The timestamp when the rule was last updated.

enabledbooleanrequired

Specifies whether the rule is enabled.

json
{
  "data": [
    {
      "ruleId": "2c0fc9fa937b11eaa1b71c4d701ab86e",
      "description": "Cache static assets on product pages",
      "expression": "(http.request.uri.path matches \"^/product/.*\")",
      "action": "cache",
      "enabled": true,
      "excludeQueryStrings": [
        "gclid",
        "utm_campaign"
      ],
      "ignoreQueryStringsOrder": true,
      "respectStrongEtags": false,
      "lastUpdated": "2022-01-01T05:20:00Z"
    }
  ]
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.