From de7c178bf175040ae783ef1866a6703d8b62c617 Mon Sep 17 00:00:00 2001 From: Yurii Date: Tue, 7 Jan 2025 07:36:57 +0300 Subject: [PATCH] refactor: added ``no-cache`` --- index.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index f49aef6..c53ceec 100644 --- a/index.html +++ b/index.html @@ -105,7 +105,9 @@ try { fwVersion.disabled = true; - const response = await fetch("https://api.github.com/repos/Laxilef/OTGateway/releases"); + const response = await fetch("https://api.github.com/repos/Laxilef/OTGateway/releases", { + cache: "no-cache" + }); const data = await response.json(); for (let release of data) { @@ -133,7 +135,9 @@ let files = []; try { - const response = await fetch(`https://api.github.com/repos/Laxilef/OTGateway/releases/${releaseId}/assets`); + const response = await fetch(`https://api.github.com/repos/Laxilef/OTGateway/releases/${releaseId}/assets`, { + cache: "no-cache" + }); const assets = await response.json(); for (const file of assets) { @@ -164,7 +168,9 @@ fwBoard.remove(1); } - const response = await fetch(`https://corsproxy.io/?url=${configUrl}`); + const response = await fetch(`https://corsproxy.io/?url=${configUrl}`, { + cache: "no-cache" + }); const boards = await response.json(); for (let board of boards) { @@ -264,7 +270,9 @@ statusContainer.textContent = "Downloading files..."; for (let file of files) { - const response = await fetch(`https://corsproxy.io/?url=${file.url}`); + const response = await fetch(`https://corsproxy.io/?url=${file.url}`, { + cache: "no-cache" + }); const firmwareArrayBuffer = await response.arrayBuffer(); const uint8Array = new Uint8Array(firmwareArrayBuffer); file.data = "";