mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-06 16:48:56 +03:00
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({
|
||||
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);
|
||||
}
|
||||
// Always add fresh timestamp to URL to prevent caching
|
||||
const timestamp = new Date().getTime();
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.set('_nocache', timestamp);
|
||||
window.history.replaceState({}, document.title, url.toString());
|
||||
|
||||
document.head.insertAdjacentHTML('beforeend', `
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user