refactor: improve caching prevention logic
This commit is contained in:
@@ -774,13 +774,11 @@ let createStatusSection = function (podkopStatus, singboxStatus, podkop, luci, s
|
|||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
async render() {
|
async render() {
|
||||||
// Add timestamp to URL to prevent caching
|
// Always add fresh timestamp to URL to prevent caching
|
||||||
if (!window.location.href.includes('_nocache=')) {
|
const timestamp = new Date().getTime();
|
||||||
const timestamp = new Date().getTime();
|
const url = new URL(window.location.href);
|
||||||
const separator = window.location.href.includes('?') ? '&' : '?';
|
url.searchParams.set('_nocache', timestamp);
|
||||||
const newUrl = `${window.location.href}${separator}_nocache=${timestamp}`;
|
window.history.replaceState({}, document.title, url.toString());
|
||||||
window.history.replaceState({}, document.title, newUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
document.head.insertAdjacentHTML('beforeend', `
|
document.head.insertAdjacentHTML('beforeend', `
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user