Skip to content

Commit dbcb542

Browse files
authored
Merge pull request AdobeDocs#91 from ryanjcohen/webhooks-response-cache
CEXT-2403: Caching webhook responses
2 parents 72c1573 + b8efb96 commit dbcb542

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/pages/webhooks/testing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ If an error occurs, or if an exception is thrown, a message similar to the follo
4444
Failed to process webhook "observer.checkout_cart_product_add_before". Or webhook endpoint returned exception operation. Error: Webhook Response: The product is out of stock
4545
Check logs for more information.
4646
```
47+
48+
Responses for a webhook endpoint may be cached if the `ttl` attribute for a hook is set. To clean the webhook response cache while testing your webhooks locally, run the following command:
49+
50+
```bash
51+
bin/magento cache:clean webhooks_response
52+
```

src/pages/webhooks/xml-schema.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The `hook` element defines the HTTP request to the remote server.
7474
| `softTimeout`| Int | A soft timeout limit (milliseconds) for the request. Requests exceeding this timeout are logged for debugging purposes. | false | Not applicable |
7575
| `fallbackErrorMessage` | Int | The error message to return when the hook fails. | false | Not applicable |
7676
| `remove` | Boolean | Indicates whether to skip a removed hook during the batch execution. | false | false |
77+
| `ttl` | Int | The cache time-to-live (in seconds) for requests with the same URL, body, and headers. If this attribute is not specified, or if the value set to `0`, the response is not cached. | false | 0 |
7778
| `headers` | Array | A set of HTTP headers to send with the request. | false | [] |
7879
| `fields` | Array | A set of fields to include in the hook payload. If not set, the entire payload will be sent. | false | [] |
7980

0 commit comments

Comments
 (0)