From e634f44178f62055e5f659075531dfef97b45a20 Mon Sep 17 00:00:00 2001 From: Martin Zanoni Date: Wed, 26 Aug 2026 10:15:30 +0200 Subject: [PATCH] Enhance README with Cache mode & Keep Alive details Updated README to include 'Keep Alive' option for cache mode and clarified its usage. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b27782d..fc3b51b 100644 --- a/README.md +++ b/README.md @@ -41,14 +41,16 @@ After which you have access to various methods depending on the client you've bo ***Note: serverUrl is not required and will default to https://api.relewise.com/*** -#### Cache mode +#### Cache mode & Keep Alive By default, clients use `cache: 'no-cache'` to ensure responses are always fresh — this prevents stale results that could break personalization. However, some service workers (often used in integrations) do not support the `no-cache` mode. +You can also configure request with `keepalive`: `true`. This can be useful to prevent tracking requests from being cancelled because the user navigated away from the page before the request compeleted. ```ts const integrator = new Integrator(RELEWISE_DATASET_ID, RELEWISE_API_KEY, { serverUrl: RELEWISE_SERVER_URL, - cache: 'default' + cache: 'default', + keepalive: true }); ```