From 5865706d0cad586daee8991a8235c64316f69e3a Mon Sep 17 00:00:00 2001 From: Ivan K Date: Thu, 20 Mar 2025 21:45:08 +0300 Subject: [PATCH] feat: add timestamp to URL to prevent caching --- .../htdocs/luci-static/resources/view/podkop/podkop.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js index e49d5dc..924d737 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js @@ -774,6 +774,14 @@ let createStatusSection = function (podkopStatus, singboxStatus, podkop, luci, s return view.extend({ async render() { + // Add timestamp to URL to prevent caching + if (!window.location.href.includes('_nocache=')) { + const timestamp = new Date().getTime(); + const separator = window.location.href.includes('?') ? '&' : '?'; + const newUrl = `${window.location.href}${separator}_nocache=${timestamp}`; + window.history.replaceState({}, document.title, newUrl); + } + document.head.insertAdjacentHTML('beforeend', `