Server: If-Modified-Since, block bis Änderung; Client: sofortiger Re-Poll

This commit is contained in:
2026-05-24 15:34:27 +02:00
parent 7efa38c91a
commit ab4486cc98
2 changed files with 27 additions and 29 deletions

11
app.js
View File

@@ -440,13 +440,12 @@ function startAutoRefresh() {
document.getElementById('refresh-timer').textContent = '● Live';
document.getElementById('refresh-timer').style.color = '#4ade80';
async function poll() {
while (true) {
const myId = ++pollId;
(async function poll() {
while (pollId === myId) {
await loadPGN(false);
await new Promise(r => setTimeout(r, 30000));
}
}
poll();
})();
}
/**
@@ -470,7 +469,7 @@ function hideError() {
*/
document.getElementById('refresh-btn').addEventListener('click', () => {
pollId++;
loadPGN(true);
loadPGN(true).then(() => startAutoRefresh());
});
/**