From f7eb6856d1ec31cd07bd294e623df0eecfd32294 Mon Sep 17 00:00:00 2001 From: apinator-dev Date: Sat, 17 Oct 2026 13:22:33 +0200 Subject: [PATCH] docs: document cache channels Add a Cache Channels section to the README covering the cache-, private-cache- and presence-cache- prefixes, the 30-minute TTL and a fallback for when nothing is cached. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 6af5b24..19bffcc 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,21 @@ await client.trigger({ }); ``` +## Cache Channels + +Publish to a channel named `cache-`, `private-cache-` or `presence-cache-` and Apinator keeps +the last event for 30 minutes, so a client that subscribes after the publish still receives it. +Nothing else changes: trigger as usual, and authorize private and presence cache channels like +any other private or presence channel. + +```ts +await client.trigger({ + name: "job-finished", + channel: `private-cache-job-${jobId}`, + data: JSON.stringify({ status: "done" }), +}); +``` + ## Channel Auth (Private/Presence) ```ts