From 8628c48db8f6adb88f5d542d529a7d98061ef3a9 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Wed, 18 Jan 2023 10:01:00 +0300 Subject: [PATCH] Add no-cache for all GET API requests --- www/devices.html | 2 +- www/homekit.html | 2 +- www/index.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/www/devices.html b/www/devices.html index ca9d1bc7..59e84942 100644 --- a/www/devices.html +++ b/www/devices.html @@ -58,7 +58,7 @@ 0, location.pathname.lastIndexOf("/") ); - fetch(`${baseUrl}/api/devices`) + fetch(`${baseUrl}/api/devices`, {cache: 'no-cache'}) .then(r => r.json()) .then(data => { document.querySelector("body > table > tbody").innerHTML = diff --git a/www/homekit.html b/www/homekit.html index 155933bc..7d9281c2 100644 --- a/www/homekit.html +++ b/www/homekit.html @@ -65,7 +65,7 @@ 0, location.pathname.lastIndexOf("/") ); - fetch(`${baseUrl}/api/homekit`) + fetch(`${baseUrl}/api/homekit`, {cache: 'no-cache'}) .then(r => r.json()) .then(data => { document.querySelector("body > table > tbody").innerHTML = diff --git a/www/index.html b/www/index.html index 9bdc00c2..4781b57f 100644 --- a/www/index.html +++ b/www/index.html @@ -133,7 +133,7 @@ function reload() { const url = new URL("api/streams", location.href); - fetch(url).then(r => r.json()).then(data => { + fetch(url, {cache: 'no-cache'}).then(r => r.json()).then(data => { tbody.innerHTML = ""; for (const [name, value] of Object.entries(data)) { @@ -153,7 +153,7 @@ } const url = new URL("api", location.href); - fetch(url).then(r => r.json()).then(data => { + fetch(url, {cache: 'no-cache'}).then(r => r.json()).then(data => { const info = document.querySelector(".info"); info.innerText = `Version: ${data.version}, Config: ${data.config_path}`;